Using jQuery to perform a GET request and using the resulting data

Posted by Filip Ekberg on Stack Overflow See other posts from Stack Overflow or by Filip Ekberg
Published on 2010-06-10T14:11:19Z Indexed on 2010/06/10 14:23 UTC
Read the original article Hit count: 209

Filed under:

I have a page, let's call it "callme.html" which only has this content:

abc

Now I want to fire the following:

$.get("callme.html", function (data) {

    alert(data);     

}, "text");

I am using jQuery 1.4.2 mini and the page is called but the alert is empty.

Any ideas why? I'd like the popup to contain abc

I've also tried the following

$.ajax({
   url: "callme.html",
   async: false,
   success: function (data) {
       alert(data);
    }
});

© Stack Overflow or respective owner

Related posts about jQuery