2

Is there a way to add an external javascript file to Home.aspx? I tried to add it to the Content PlaceHolder - PlaceHolderAdditionalPageHead but it didn't work (meaning that the link did not appear in Developer Tools and the test "alert" didn't fire).

I also tried to add a Script Editor Webpart but was also unsuccessful.

I already have three JavaScript Display Templates styling lists on the page and they work fine. What I need to do now is to add a backbone.js corporate directory application to the page and none of the documentation I read showed me HOW to insert the js file so that it would fire after document.ready.

I have read about creating a visual webpart in VS2012/VS2013 to add Backbone to a page but our network engineer has not been able to correctly configure our site collection for VS app development so I am trying to find a workaround solution so that I can meet my deadline even if he fails to meet his.

The Visual Studio issue is that when I press F5 to test the build, the build completes properly but I am presented with a credential dialog that will not allow ANYONE to log in through. I am a site collection admin and site admin on the site collection and I still get access denied after the build and our network guy can't solve this.

Thanks in advance.

1

The Visual Studio issue is that when I press F5 to test the build, the build completes properly but I am presented with a credential dialog that will not allow ANYONE to log in through. I am a site collection admin and site admin on the site collection and I still get access denied after the build and our network guy can't solve this.

This sounds like old Loopback Check - http://support.microsoft.com/kb/896861/en-gb

Is this SharePoint 2013? Try disabling the Minimal Download Strategy Feature (in Site Features) then retry your methods. I've found this interferes with third party libraries.

  • I forwarded your suggestion on the Loopback Check to the network guy and he is working on that ... thanks! – jgravois Feb 3 '14 at 17:42
  • I disabled Minimal Download Strategy and re-added the js file in the Content PlaceHolder - PlaceHolderAdditionalPageHead but the file is still not showing in Developer Tools. The file only has a document ready function with alert('loaded'); in it but I get nothing. – jgravois Feb 3 '14 at 17:44
  • Try again to add a <script /> tag inside a Script Editor Web Part. You might need two, one to reference your library and the second with the code you want to run (in this case, the simply alert() in the document ready function. – James Love Feb 3 '14 at 17:46

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.