0

I am working on CEWP.when I am trying to debug the javascript file.On button click i called a function but function is not getting called becos js file not loaded properly .At the end of js file some ctag paramater got added.

enter image description here

I would like to know the reason.Please anyone assist me.

Thanks Swetha

  • As @Joe McShea said, purpose of ctag is to get alway load the updated/latest file from the source and not the cached version. I do not think this issue is because of ctag. Please check if yo are getting any error in console after you click on button. If there is any error, please share the error message. – Rohit Waghela Apr 11 at 13:13
0

Try this.

  1. Create a HTML file and JS file.
  2. Upload JS file inside sharepoint
  3. get the link of JS and append it to HTML file and then upload the HTML to your sharepoint
  4. Get the URL of the html and put inside your CEWP and then try debugging.

Let me know if not working.

  • I did the same. – Swetha Paritala Apr 10 at 6:23
  • have a try in incognito. – Sukumar MS Apr 10 at 7:02
  • tried in incognito also..same issue.and im getting access denied in suiteserviceproxy.aspx..im using enterprise e3 trail version.why i am getting this error any idea? – Swetha Paritala Apr 10 at 8:20
  • Try this.. Create a simple javascript code and a html in the same way as you did previously. Just add a button click and to pop up an alert. If it works then the problem is with your code. You can post code here, if you wish to do so that i can help better – Sukumar MS Apr 11 at 6:59
0

The ctag is added for cache busting. If you change the source file, the ctag will change, thus the URL changes so the browser will not load an older cached version of the source file. But anything that is added to the URL after the question mark (i.e. parameters) does not affect the loading of the source file by the browser.

If you're JavaScript is not getting loaded, it's not because of the ctag. The most likely reason is that there is a syntax error. In the case of the CEWP, it is not expecting a JavaScript file and will not load it correctly. It's expecting an HTML file. So a JavaScript file that looks like:

$().documentReady(function() {});

will not get loaded correctly by the CEWP, but:

<script type="javascript>
    $().documentReady(function() {});
</script>

will get loaded correctly. The first is a JavaScript file, the second is an HTML file with some JavaScript.

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.