简体   繁体   English

SharePoint框架内aspx页面中的Javascript链接将撇号替换为#39元素

[英]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');" 我对SharePoint编码的javascript链接有问题,该链接通常呈现为href =“ javascript:Function('url');” but in Sharepoint like href="javascript:Function(& #39;url& #39;)" wich of course does not work. 但在Sharepoint中,例如href =“ javascript:Function(' url')”当然不能正常工作。

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? 在Web部件中,是否有自定义控件等?

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. 如果您尝试使用内容编辑器Web部件,我在2010年确实注意到了一些区别。当尝试使用需要JavaScript的项目时,我只是创建了一个驻留在SiteAssets中的.txt文件。 The file contains all the HTML/JS that I would normally add to the web part. 该文件包含我通常会添加到Web部件的所有HTML / JS。 Then point/link the Content Editor web part at that file. 然后将Content Editor Web部件指向/链接到该文件。

This seemed to fix some issues I was having. 这似乎解决了我遇到的一些问题。 Could work for you. 可以为您服务。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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