0

I am using script editor for JSOM which includes java-script and css tags.

My jsom code is working fine only when URL is http://portalurl?PageView=Shared&InitialTabId=Ribbon.WebPartPage&VisibilityContext=WSSWebPartPage

Can any one please help me in knowing what's the issue and how can I solve it?

  • what are the webpart properties ? – Sunil Sahu Mar 26 '18 at 9:00
  • Try adding the type="text/javascript" in the <script> tag references, like this – Ankitkumar Malde Mar 26 '18 at 11:12
0

edit the page where the web part is placed and select the webpart by checking it, and look for the webpart whether it is minimize/restore. If it is showing option as restore then click on restore and your script may work.

0

It may be the time it takes to load the libraries (like sp.js and your oyher dependencies). When you are in the edit URL it takes more time to load Standard sharepoint components and the your script works. Try to use javascript settimeout (https://www.w3schools.com/jsref/met_win_settimeout.asp) and asks to wait for one second (just as test) if it works use SP.SOD (https://msdn.microsoft.com/en-us/library/office/ff408081(v=office.14).aspx)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.