1

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?

3 Answers 3

4

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.

Sign up to request clarification or add additional context in comments.

Comments

0

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.

1 Comment

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

Use YQL - http://developer.yahoo.com/yql/guide/yql-code-examples.html#yql_html_scraper

It essentially acts as a proxy to grab page data for you through their service. You can interact with it solely with JavaScript.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.