Sharepoint 2007 占位符问题
我在 jQuery 中为一些额外的 javascript 创建了一个简单的占位符 - 问题是占位符位于某些脚本标记内,因此 Sharepoint 设计器无法识别。
该页面工作正常,所以直到现在它还没有困扰我,因为如果不解决问题,你就无法触摸设计视图的任何部分。
我的代码在主模板中看起来像这样:
<script type="text/javascript>
$(document).ready(function(){
<asp:ContentPlaceHolder id="PlaceHolderjQuery" runat="server" />
});
</script>
有没有一种方法可以使其正确工作,以便 Sharepoint Designer 实际上能够识别占位符?
感谢您的帮助!
I've created a simple placeHolder for some extra javascript in jQuery - The issue is that the placeHolder is within some script tags and therefore isn't recognized by Sharepoint designer.
The page works correctly, so it hasn't bothered me until now, since you can't touch any part of the design view, without fixing the issue.
My code looks something like this in the master template:
<script type="text/javascript>
$(document).ready(function(){
<asp:ContentPlaceHolder id="PlaceHolderjQuery" runat="server" />
});
</script>
Is there a way to make this work correctly, so that the placeholder is actually recognized by Sharepoint Designer?
Thanks for the help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我了解到您正在尝试调用在 PlaceHolder 中定义的 JavaScript 函数。
但是您的代码将无法工作,因为 PlaceHolder 是服务器控件,并且将其作为其他标签的子元素推送将无法工作。脚本标签是客户端处理标签。所以我建议改变如下逻辑。
在母版页中,我将默认使用 JavaScript 来调用函数。
我将使用虚拟函数定义内容占位符
现在,您可以在您的内容页面中定义
I understood that you are trying to call a JavaScript function that is defined inside the PlaceHolder.
But your code wont work as the PlaceHolder is a Server Control and pushing it as a child element of the some other tag wont work. Script tag is a client processing tag. So What I would suggest is to change the logic as below.
In the master page I will have a JavaScript to call a function by default.
And I will define the content Place Holder with a dummy function
Now in your content page you can define