Leagis Leagis - 1 year ago 118
Ajax Question

$.get is not a function

I want to get some data over JS and therefore I "develop" a small script. Actually I haven't worked with JS/JQuery for a long time and now I'm facing a very basic problem. I tried to replace the

but I got the same error.


<script type="text/javascript" src="jquery-3.1.1.slim.min.js"</script>"></script>
<script type="text/javascript" src="main.js"</script>"></script>


jQuery.get("mydomain", function(data, status){
alert("Data: " + data + "\nStatus: " + status);

Answer Source

You are referencing jQuery Slim, which doesn't include (among other things) the Ajax functions such as .get().

You need to reference the full version of jQuery instead.

See this link for more a detailed description of what is and is not included in the Slim build: https://blog.jquery.com/2016/06/09/jquery-3-0-final-released/

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download