简体   繁体   中英

Javascript link in aspx page within a SharePoint frame replaces apostrophes to #39 element

I have problem with SharePoint encoding the javascript link, that normally renders like href="javascript:Function('url');" but in Sharepoint like href="javascript:Function(& #39;url& #39;)" wich of course does not work.

What do I need to do?

I need to be able to use my user control as stand alone as well as linked into a sharepoint page, right!?

Where are you inserting the code? Within a web part, a custom control, etc?

If you are trying to use the Content Editor web part I did notice some differences with it in 2010. When trying to use items that require javascript I just created a .txt file that resides in the SiteAssets. The file contains all the HTML/JS that I would normally add to the web part. Then point/link the Content Editor web part at that file.

This seemed to fix some issues I was having. Could work for you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM