Reputation: 13
Here is a jquery script that i am trying to use on my social engine site. I am getting a Jquery Not defined error.
What could I do to fix this
<script src="ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script type="text/javascript">var QueryString = function () {
// This function is anonymous, is executed immediately and
// the return value is assigned to QueryString!
var query_string = {};
var query = window.location.search.substring(1);
var vars = query.split("&");
for (var i=0;i<vars.length;i++) {
var pair = vars[i].split("=");
// If first entry with this name
if (typeof query_string[pair[0]] === "undefined") {
query_string[pair[0]] = pair[1];
// If second entry with this name
} else if (typeof query_string[pair[0]] === "string") {
var arr = [ query_string[pair[0]], pair[1] ];
query_string[pair[0]] = arr;
// If third or later entry with this name
} else {
query_string[pair[0]].push(pair[1]);
}
}
return query_string;
} ();
jQuery(function() {if(QueryString.u != undefined){if(QueryString.p != undefined){jQuery('#email').val(QueryString.u);
jQuery('#password').val(QueryString.p);
jQuery('#submit').click();}}});
</script>
Upvotes: 1
Views: 220
Reputation: 29032
You're missing a protocol.
You can either specify http://ajax.googleapis...
or use @sunpietro's answer and use //
Upvotes: 3
Reputation: 2099
you should add <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
in the top of your code
Upvotes: 3