So, is it possible to add a link as follows (or some equivalent to this)

<a href="javascript:somefunction()">Click Here</a>

into the Sharepoint page, but without using Content Editor Web Part.

Basically I want to open a new list item form from another site collection's list, and I need to open it in modal dialog, and I have working javascript function that allows me to do just that, but I can't call that function from the link itself because Sharepoint keeps stripping my javascript code when I'm saving the changes. In the other hand, CEWP can not be added to the sharepoint page itself.

Do you insert any customizations to your page like jQuery library or other javascripts scripts?
–
veritasJan 17 '13 at 21:01

Yes, I have a javascript function that is displaying a form in modal dialog. I can keep that script in masterpage, but I'd rather add it directly to the page itself
–
EedohJan 17 '13 at 21:03

1

Why you can't add Content Editor Web Part, it will not even be visible on the page... Just include the <script> block in that and from Web Part properties choose Chrome Type=None
–
Arsalan Adam KhatriJan 17 '13 at 21:09

For some reason, Sharepoint does not allow me to add content editor on this page. It's disabled in the ribbon.
–
EedohJan 17 '13 at 21:10

Use SP Designer to add your javascript code. It will allow you to add.
–
sssreddyJan 17 '13 at 21:30

Thanks for the reply, I liked this approach very much, and I was convinced it's gonna work, but it does not. When I do this the link is not clickable at all. It looks like a link, but mouse cursor now even does not change when I hover over it, nor anything happen when I click it.
–
EedohJan 24 '13 at 14:09