JavaScript

Moderators: None (Apply to moderate this forum)
Number of threads: 2061
Number of posts: 5164

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
windows.open? Posted by clean20s on 3 Feb 2005 at 12:58 PM
How do I open another website and enter text, then submit. For example, is there a way that I can open www.google.com , enter a word to search, select search and have the new window be the window with the results? I found an example here http://www.tek-tips.com/faqs.cfm?fid=4872 but i want the java-script code to actually open up a website, enter data, then submit.
Report
Re: windows.open? Posted by the walrus on 3 Feb 2005 at 2:39 PM
This message was edited by the walrus at 2005-2-3 14:44:39

: How do I open another website and enter text, then submit. For example, is there a way that I can open www.google.com , enter a word to search, select search and have the new window be the window with the results? I found an example here http://www.tek-tips.com/faqs.cfm?fid=4872 but i want the java-script code to actually open up a website, enter data, then submit.
:

you can only do that if it's a website on the same domain as the script that would do that (maybe even the same relative location.. ie folder, etc). you wouldnt be able to open google and make a script type in a search, because that would be a huge security risk, so javascript blocks that. think if someone made some javascript that opened a hotmail window and sent a virus everyone on that person's contact list. or if someone made some javascript that opened a popular website that has access to people's money, like amazon, and bought a ton of stuff from accounts that were already signed in.. you can however open a window that shows search results from google by telling it to go to http://www.google.com/search?hl=en&q=search+item. but you cannot enter data into a form on someone else's website.

if you wanted to enter data in a form on your website, then something could probably be done. i think javascript only checks to make sure the webpage is in the same relative location, and if so itll let you do what you want to the page. otherwise you dont have access to it.




 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.