views:

29

answers:

2

Hi,

have the following code:

$(document).ready(function() {
        $.get("https://www.somesite.com/Securepay/Return.aspx, function(data) {
            alert(data);
                $("#result").html(data);
            });

        });

the above code does not return the html. Does anyone have a solution? thanks

A: 

What do you mean by not returning the HTML Code? If you mean that the alert displays the HTML Code, but the #result item doesn't, try changing the .html( to .text(

Kranu
Please add questions as *comments*.
KMan
I'm sorry, but I don't have commenting privileges yet. Plus, this isn't just a question. It has an answer too.
Kranu
??? try $.get("http://google.com") and the alert method will be called. But not being called for https
It's possible that you are prevented from doing this due to cross-site scripting security. HTTPS is meant to be secure, so xss security is stopping you from loading the page. Since you're using get, try setting up a global ajax error function (http://api.jquery.com/ajaxError/) to tell you what the problem is.
Kranu
no error being displayed
Could you post the code you're using for the ajaxerror function and what browser you're using?
Kranu
A: 

There's a " missing after the url:

$(document).ready(function() {
    $.get("https://www.somesite.com/Securepay/Return.aspx", function(data) {
        alert(data);
        $("#result").html(data);
    });
});
alopix
it was just a typo so it is not the actual problem!
Then it could be cross-site-scripting, which is not allowed with ajax. Same-origin-policy for ajax-request.
alopix