I am trying to insert following snippet in my JSP file
{
$.ajaxSetup({
cache: false,
async: false
});
var ajax_load = "loading data please wait...";
var loadUrl = "abc.jsp";
$("#seoarea").html(ajax_load).load(loadUrl, {
param1: holdvalue1,
param2: holdvalue2
});
}
While running this on mozilla firefox its throwing "$.ajaxSetup is not a function" error.
It also can happen if you are using slim version of the library. Slim version does not include ajax.
Go here to get the latest version: https://code.jquery.com/
Credits go to Gus: TypeError: $.ajax(...) is not a function?
This error could happen if you forgot to reference the jQuery library in your page:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"></script>
For newest version, check this link: https://code.jquery.com/
It could also happen if you are using other js libraries such as prototypejs which also use the $
function and there could be a conflict. If this is the case you may take a look at this article on how to resolve the issue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With