SharePoint页面上写javascript代码

有两种办法:

1)使用Content Editor web part
add content editor web part ->click Format Text Tab on ribbon -> click edit source -> add code

2)使用Script Editor Web Part
add script editor web part -> click Edit Shippet -> add code

尝试把下面链接里面的javascript在页面上面正常跑起来,直接把代码copy进去改了一下URL,然后直接显示code,并没有执行。需要把code放在一个里面才行。由于都是方法,所以在最后调用了一下这个方法。
https://docs.microsoft.com/en-us/previous-versions/office/developer/sharepoint-2010/hh185008(v=office.14)

参考:https://docs.microsoft.com/en-us/sharepoint/dev/sp-add-ins/complete-basic-operations-using-javascript-library-code-in-sharepoint

猜你喜欢

转载自blog.csdn.net/WendyXu8230/article/details/82744228
今日推荐