0

For a certain project I am working on I have to read the text of a webpage on another domain with Javascript. The webpage will only contain "true" or "false" which I have to get the value of. I was told I could make an iframe and check its innerHTML but that does not seem to work .. ideas? (i would rather not use jquery)

Anmol Mago
  • 23
  • 1
  • 3

2 Answers2

1

Do you really need to use javaScript - cannot it be done on the server side (server side ie. php would http to the site that you want to get content from and then make actions based on the content on the response)?

Alternatively I looks like simply it is a good candidate for a javascript ajax call to the site you want to read content from - you can do ajax easyly with jquery or many other js frameworks, it is possible to do it without any frameworks as well but it would be more difficult and less proof save. Be worn thought that for cross domain ajax calls you will have problems so you will end up anyway with server side implementation: similar topic here: AJAX cross domain call

Community
  • 1
  • 1
rgasiore
  • 140
  • 7
0

impossible, for security reasons.

otherwise i would make an iframe of facebook's login page, and read the html and the stored user/password and hack everybody's account ;) or put the url of one of the pages on the website of your bank account

galchen
  • 5,252
  • 3
  • 29
  • 43