0

Possible Duplicate:
Ways to circumvent the same-origin policy

Please help.. Mainly I want to parse a HTML from a different URL using JavaScript so I can find there if a class exists and I can show the result on my page if it exists or not.

Community
  • 1
  • 1
user1844923
  • 179
  • 1
  • 11

1 Answers1

3

I don't know your enviroment, but it looks like a jsonp :)

http://en.wikipedia.org/wiki/JSONP

1) You avoid same origin policy because You use src attribute of script tag.

2) You can have everything sent right into your callback function.

op1ekun
  • 1,918
  • 19
  • 26
  • if the JSONP is not enabled on that domain how it can be solved? – user1844923 Nov 22 '12 at 13:21
  • I'm afraid there is no other solution. I've have tried once to workaround same origin policy by using iframe. The problem is You cannot access contents of iframe (tested on firefox and chrome). Sorry. – op1ekun Nov 22 '12 at 14:18
  • Thanks, than I think I'll go with cURL php for a server side parsing, but I'll need to solve the login form – user1844923 Nov 22 '12 at 15:19