tags:

views:

24

answers:

2

My actual problem is, I am opening a site www.abc.com. And I am selecting few options and clicking on Submit there. Now a new browser is launched with url xyz.com. (Complete new instance of I.E is launched)

The new browser URL (www.xyz.com\1222) is framed with the selection I have made in abc.com. So when I change the selection, the URL gets changes.

So, I was thinking like... Once I open a www.abc.com. Made selection and hit Submit. A new I.E browser will automatically open up with xyz.com. (ex. www.xyz.com\1222xy) Now what to do to access the objects of xyz.com. (As www.xyz.com is opened now in new browser. And also www.abc.com is also still open.) I can access the object of abc.com but not of xyz.com. Can you help me with code to access the objects of xyz.com.

A: 

Modifying a browser window showing a page from xyz.com, from a page showing abc.com, is not possible (and that's a Good Thing). You seem to be running into the Same Origin Policy here. This is a security measure: to put it simply, JavaScript of one site cannot manipulate another site.

This is what SOP is trying to prevent: the user opens a link to http://evilsite.example.net/ ; that's a page with frames. The top frame is so small it's almost invisible (and loads http://evilsite.example.net/frame.html ); the bottom frame is http://yourbank.example.com/ . Now the user logs into YourBank's page - but the login data are snooped out by evilsite's Javascript from the other frame, or evilsite waits until the user logs in, then manipulates yourbank's page to send your money to Elbonia. (There are other scenarios, but this is the most obvious one)

Piskvor
A: 

For security reasons, you cannot interact with a page in a different domain.

SLaks