Uncaught ReferenceError: $ is not defined
Uncaught ReferenceError: $ is not defined. It looks like below:
The problem was also coming because the jQuery was not loading properly on the page. To work with jQuery we need to refer jQuery.min.js file. Once I gave the references like below, the error did not come.
Uncaught TypeError: Cannot read property ‘SPGetCurrentUser’ of undefined
While working with SharePoint online client object model, I got the below error which says: Uncaught TypeError: Cannot read property ‘SPGetCurrentUser’ of undefined. It looks like below:
I was using SPServices to retrieve current user details like below:
var thisUser = $().SPServices.SPGetCurrentUser();
To work with SPServices, we need to refer both jquery.min.js and jquery.SPServices-2014.02.min.js files like below:
Once you will refer the above .js files then the error will not come.
You may like following jQuery tutorials:
- Uncaught ReferenceError: function is not defined
- Cascading dropdown in SharePoint 2013/2016/Online using jQuery
- How to retrieve Query String Value using JQuery in SharePoint Online?
- Bind current date to date picker control using jQuery in SharePoint Online
- Hide page title in SharePoint Online/2013/2016/2019 using jQuery or CSS
- Bind SharePoint Online List Data into HTML table or jQuery Datatable using jQuery and Rest API
- How to make synchronous Rest API call in SharePoint Online
This tutorial, we learned how to fix error, Uncaught ReferenceError $ is not defined and Uncaught TypeError Cannot read property ‘SPGetCurrentUser’ of undefined
Hello Everyone!! I am Bhawana a SharePoint MVP and having about 10+ years of SharePoint experience as well as in .Net technologies. I have worked in all the versions of SharePoint from wss to Office 365. I have good exposure in Customization and Migration using Nintex, Metalogix tools. Now exploring more in SharePoint 2016 🙂 Hope here I can contribute and share my knowledge to the fullest. As I believe “There is no wealth like knowledge and no poverty like ignorance”