tags:

views:

87

answers:

2

I want to get the data from http://whatismyip.com/automation/n09230945.asp using JavaScript. How can I do this?

I can get the data from ASP.NET by using WebClient class but how can we get data using JavaScript?

+4  A: 

You will need to use AJAX. However, unless the service provides a JSONP interface, AJAX is limited to getting pages from the same domain as the page it runs on. See: Same origin policy.

Max Shawabkeh
A: 

The way to get around the same origin policy is to write a script in ASP on your own server that gets the data, and then get that script through AJAX in your page.

sp
And of course, that will repeatedly tell the original poster the external IP of his own server. :)
Randal Schwartz