无法编辑/查看/删除在Office 365共享点在线页面中添加的脚本编辑器Web部件 [英] unable to edit/view/delete the script editor web parts which i add inside my office 365 sharepoint online pages

查看:72
本文介绍了无法编辑/查看/删除在Office 365共享点在线页面中添加的脚本编辑器Web部件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Office 365页面中面临这种奇怪的行为.在这里,我有一个团队网站和一个企业Wiki网站,它们都有相同的问题.这是问题的详细信息:-

I am facing this weird behavioure inside my Office 365 pages. where i have a team site and an enterprise wiki site and they both have the same problem. here is the problem details:-

  1. 编辑页面(站点页面或企业​​Wiki页面).
  2. 添加脚本编辑器Web部件或向页面添加代码片段Web部件.
  3. 在其中编写代码脚本编辑器Web部件或代码段内.
  4. 保存我的页面.
  5. 脚本将在其中正常运行.我可以看到脚本的效果.

现在,当我再次编辑页面时,找不到脚本编辑器Web部件或代码片段.尽管如果我再次保存该页面,脚本效果将会存在...因此似乎有些原因阻止了我访问/查看脚本编辑器 Web部件,当我处于编辑模式时...所以任何人都可以这样做吗?

now when i edit the page again, i can not find the script editor web part or the code snippet. although if i save the page again , the script effect will be there... so seems there is something that is preventing me from accessing/viewing the script editor web part when i am on edit mode... so can anyone adivce on this please??

现在,在进一步探讨了这个问题之后.我发现,如果我添加了脚本编辑器Web部件并重命名了它,那么我就可以对其进行编辑.但是如果我将其名称保留为脚本编辑器",那么我将无法对其进行编辑或查看!但问题是我已经 已使用默认的脚本编辑器"添加了一些脚本编辑器Web部件,名称,而我无法编辑/查看/删除它们..任何人都可以对此提出建议吗?

now after exploring this issue more.i find that if i add a script editor web part, and i rename it, then i can edit it. but if i keep its name as "Script Editor", then i will not be able to edit it or view it!! but the problem is that i already have added some script editor web part with the defualt "Script Editor" name, and i am unable to edit/view/delete them .. can anyone advice on this please?

我还检查了网页源,发现脚本编辑器被设置为hidden,这是脚本编辑器的相关标记:-

i also check the web page source and i find that the script editor is being set as hidden , here is the related markup for the script editor:-

<input type="hidden" name="b55cae49-2cea-4599-91c4-cca40976590fscriptcontent" id="b55cae49-2cea-4599-91c4-cca40976590fscriptcontent" value="&lt;script&gt;

   var treeField = GetUrlKeyValue(&quot;TreeField&quot;);
   var treeValue = GetUrlKeyValue(&quot;TreeValue&quot;);

   if(treeField &amp;&amp; treeValue){
      window.location = &quot;/sites/InfoHub/Pages/Forms/AllItems.aspx?TreeField=&quot;+treeField+&quot;&amp;TreeValue=&quot;+treeValue;
   }

  
&lt;/script&gt;" />

当我以查看模式查看页面并检查页面源代码时,我可以看到脚本编辑器Web部件的以下标记:-

While when i view the page on view mode and i check the page source, i can see the following markup for the script editor web part:-

<div WebPartID="a9754c10-0d56-4ba0-8b11-9305d5c4ae37" WebPartID2="b55cae49-2cea-4599-91c4-cca40976590f" HasPers="false" id="WebPartctl00_ctl39_g_b55cae49_2cea_4599_91c4_cca40976590f" width="100%" class="ms-WPBody noindex " allowRemove="false" allowDelete="false" allowExport="false" style="" ><div id="ctl00_ctl39_g_b55cae49_2cea_4599_91c4_cca40976590f">
        <DIV class="ms-rte-embedcode ms-rte-embedwp"><script>

   var treeField = GetUrlKeyValue("TreeField");
   var treeValue = GetUrlKeyValue("TreeValue");

   if(treeField && treeValue){
      window.location = "/sites/InfoHub/Pages/Forms/AllItems.aspx?TreeField="+treeField+"&TreeValue="+treeValue;
   }


</script></DIV>

那么发生了什么 !!为什么在编辑页面时无法查看/编辑/删除脚本编辑器Web部件?

so what is going on !! why i am unable to view/edit/delete the script editor web part, when i edit the pages?

谢谢

推荐答案

要清除现有的代码段/CEWP,请执行以下操作:

To clear the existing Code Snippets/CEWP:

出现问题的页面上:

  1. 页面选项卡
  2. 编辑属性
  3. 在维护视图中打开Web部件页面
  4. 删除包含脚本的Webparts

要解决:

  1. 将脚本复制到文本文件中
  2. 保存在站点资产中
  3. 将内容编辑器添加到页面中
  4. 编辑属性
  5. 在内容链接"字段中将链接添加到您的文本文件.
  6. 将镶边类型更改为无".

现在,您可以编辑脚本,无需编辑页面即可重新上传.

Now you can edit your script, reupload without needing to edit the page.


这篇关于无法编辑/查看/删除在Office 365共享点在线页面中添加的脚本编辑器Web部件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆