<!DOCTYPE html>
<html>
<head>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js">
</script>
<script>
$(document).ready(function(){
$("button").click(function(){
for(int i = 0; i < 10; i++){
$.get("http://www.w3schools.com/jquery/tryit.asp?filename=tryjquery_ajax_get",function(data,status){
//alert("Data: " + data + "\nStatus: " + status);
});
}
});
});
</script>
</head>
<body>
<button>Send an HTTP GET request to a page and get the result back</button>
</body>
</html>
<!DOCTYPE html> <html> <head> <script src=//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js> </script> <script> $(document).ready(function(){ $(button).click(function(){ for(int i = 0;
Share
Your syntax in faulty, try to open your file in for example Chrome Developer’s Tools: you’ll get a
Uncaught SyntaxError: Unexpected identifier. This is because JavaScript isnt’ C: you cannot define a variable to be a type, like you do on line 9, you need to define it using thevarkeyword like this:Running that on the editor of w3schools work for me.