Thursday, 12 April 2012

Include JavaScript with Code in CEWP

I was trying to programmatically insert a JavaScript src code into a Content Editor Web Part.


The problem was that using the Content Link, when I insert the link to the file, it worked, but when I try a

 <script src="/test/SiteAssets/World.js" type="text/javascript"></script> 


No hello box appeared!

Cost me about 3 hours when I thought I try to use

alert ('hello');

without the <script> tag in my World.js file. That worked!

No comments:

Post a Comment