There's a demo right there.
Cross Domain Scripting
Collapse
X
-
In this link a iframe is there ... which refers to cross domain
Please check out it's source code ...
There no buttons has onClick handler then how it fires a code on Click event ?
Now how it finds out the function body of $ as it's defined in another JS file?
Please clarify me these queries.. :)Comment
-
Today morning i tested out a code which allows me to access the cross domain elements.
Have a look at my code .........
This is the home page of Domain1.
Code:<frameset border="0" rows="50%,*"> <frame name=domain1 id=domain1 src="index.jsp?"/> <frame name=domain2 id=domain2 src="http://localhost:8084/Domain2/"/> </frameset>
The content of index.jsp which is from Domain1....
Now the home page of Domain2 ......Code:<head> <script type='text/javascript'> function callMe(){ window.parent.frames['domain2'].document.getElementById('text_box').value = 'Debasis Jana'; } </script> </head> <body> <input type=button name=click value="Click Me" onclick="callMe()"/> </body>
Now how it is possible to access the text box[of Domain2] from Domain1?Code:<body> <input type=text name=text_box id=text_box value=""/> </body>
Can anyone help me to figure me out ?Comment
-
In addition to the link posted by gits in post #22, take this and adapt it. I suggest the best course of action is to take the two pages from the different domains and try getting it to work at your domains. Once you have it working, it should be trivial to adapt it to your requirements.Comment
-
Anyway now i understood what is cross domain ...
One more good news .... Thanks Acoder ..now i able to manage my things work . The link is very useful to me ... ;)
Actually i could not get the location hash but i could set the hash value ..really it was amazing to work with that link .. thanks Acoder.Comment
Comment