Click here to Skip to main content
15,884,986 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,

i have tried this code to get content from external url but unfortunately i'm not getting. May be i'm getting some where wrong.

Please help me, guys.

Thanks

<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
<script>
$(document).ready(function(){
//this code is working smooth
    $("button").click(function(){
        $.get("demo_test.asp", 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>


What I have tried:

<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
<script>
//this code is not working
$(document).ready(function(){
    $("button").click(function(){
        $.get("http://www.xxx.com/yy/an/2016Mar24", function(data, status){
            alert("Data: " + data.text() + "\nStatus: " + status);
        });
    });
});
</script>
</head>
<body>

<button>Send an HTTP GET request to a page and get the result back</button>

</body>
</html>
Posted
Comments
Patrice T 27-Mar-16 3:07am    
No documentation ? no tuto ?
John C Rayan 27-Mar-16 4:06am    
Are you aware of xss?
abdul subhan mohammed 27-Mar-16 4:07am    
no
John C Rayan 27-Mar-16 4:10am    
What error are you getting ?
abdul subhan mohammed 27-Mar-16 5:37am    
displaying no error

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900