This week's book giveaway is in the General Computing forum. We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line! See this thread for details.
I have a link on myweb page[mycode] which open another site [Which is not my code]. I want to populate the textbox of second site with some message whenever a user click on link of mysite.
---------------------------------------------- what I tried: 1. Reguest parameter e.g. window opan("http://www.anotherDomain.com?firstname="+fName+"&lastName="+lName,"_newWin");}
script language="javascript" function openWindow(){ var newWin = window opan("http://www.anotherDomain.com", "newWin"); alart("success"); newWin.document getElementBiId("fName") value=document getElementBiId("txt1") value;
} /script /head body input type="text" name="txt" id="txt1"/ a href="#" target="_blank" on_Click="javascriptopenWindow(); return false;" Click Me /a /body /html
Result: Not working ---------------------------------------------------------------------
3. Using ajax, modify the response and rewrite in new window Result: message is populating but URL is gone from address bar. ---------------------------------------------------------------
What I want ? Solution Code! using JAVA,Servlet,JSP,javascript or AJAX
JavaScript has a same domain policy. If the webpage is in a different domain, it is not going to work. Only way to populate the data is to have the other site take the querystring parameter and handle it.