1

I was doing some coding work through the content editor webpart on a page. The code uses jQuery, and the execution of that page do have some errors, but mostly insignificant ones. The script file is hosted on SiteAssets. This page loads jQuery properly with no issues. Let's call this page 1, and the original script here script.js within SiteAssets.

After that, I started doing another testing page (Let's call this page 2). I copied some code from the script on page 1 and started working. However, after I got done and the file was uploaded to SiteAssets, and I linked the script to the new page using another CE webpart, jQuery failed to load properly. I initially thought I have something wrong in the code, but I tried the usual routine to no avail. Then I thought to myself - why is jQuery not loading? Let me just use the same original script.js in page 1 to see if it is working on page 2. And to my surprise, it did not work. The error code on page 2 is shown below:

JQuery321.min.js:2 jQuery.Deferred exception: Cannot read property 'ajax' of undefined TypeError: Cannot read property 'ajax' of undefined

I have carefully compared all the toggles within the webpart settings, but they appear to be the same. Both page 1 and page 2 only have 1 content editor webpart that has a script file attached to it. Page 2 has been tested on separate instances on Firefox (47.0.2) and Chrome (63.0.3239.108), and both failed.

My question is then this - is there some approval process behind the scenes that I am not aware of that held the page up from being able to execute code? If not, what might be the cause of this strange scenario?

Thanks!

EDIT:

I tried using the same file that did not seem to be able to load jQuery on the page 1, and it worked with completely different error messages. Which further proves that something seems to be not working right. The current page has 3 web parts including some query string webpart. I replicated the other webparts that I think are irrelevant as well, but they still did not work. I am not sure how I should approach this, but I have requested assistance from administrators. If you have suggestions on how I should handle this, would appreciate it.

Your Answer

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

Browse other questions tagged or ask your own question.