jquery - jsfiddle - Simple Ajax request -


i beginner jquery , trying call simple request. here's jsfiddle:

http://jsfiddle.net/xvrnl/

i using code:

html: <button>click me</button> 

and

jquery: $("button").click(function() {     $.ajax({         url: "http://jsfiddle.net/echo/html/",         success: function(result) {             alert("data: " + result);         }     }); }); 

but doesn't work. reading documentation doesn't me. can suggest solution?

thank much

........

these reasons problem:

  1. you have refer jquery library reference jsfiddle
  2. you cant use absolute urls ajax requests. please refer following answer more information.

$.ajax call working fine in ie8 , doesn't work in firefox , chrome browsers


Comments

Popular posts from this blog

c++ - Function signature as a function template parameter -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -

How to call a javascript function after the page loads with a chrome extension? -