hamboy
-
Total Posts
:
92
- Scores: 6
-
Reward points
:
0
- Joined: 7/11/2005
-
Status: offline
|
Opening new tab/browser in Javascript
Saturday, December 01, 2007 5:52 AM
( permalink)
Hi does anyone know how to open a new browser (detect when using IE) or new tab (detect when using Firefox) and navigate to another website on button click? I am trying to convert my vbscript to javascript. THis is what I had for vbscript:
Sub Check_OnClick
'retrieve data from current form
Dim username : username = Document.LoginForm.username.value
Dim password : password = Document.LoginForm.password.value
'start another IE window to login
Dim objIE : Set objIE = CreateObject("InternetExplorer.Application")
objIE.Visible = True
objIE.Navigate "file://c:/search.html"
Do While objIE.Busy
WScript.Sleep 500
Loop
objIE.Document.Login.USER.value = username
objIE.Document.Login.PASSWORD.value = password
objIE.Document.Login.submit
End Sub
|
|
|
|
TNO
-
Total Posts
:
2094
- Scores: 36
-
Reward points
:
0
- Joined: 12/18/2004
- Location: Earth
-
Status: offline
|
RE: Opening new tab/browser in Javascript
Saturday, December 01, 2007 7:03 AM
( permalink)
instead of button click you could use hyperlink click: <a href="blah.html" target="_blank">Submit</a> IE6 will open a new window. IE7 and FF will open a new tab (for both browsers this can be overridden by the user in the options)
To iterate is human, to recurse divine. -- L. Peter Deutsch
|
|
|
|
hamboy
-
Total Posts
:
92
- Scores: 6
-
Reward points
:
0
- Joined: 7/11/2005
-
Status: offline
|
RE: Opening new tab/browser in Javascript
Saturday, December 01, 2007 10:35 AM
( permalink)
that's a good idea.. is it possible to hide the new window, so it'll seem everything is done in the background automatically? i need to call a javascript functino to get the entered data from the form, go to another website, fill in THAT form with the stored info
<message edited by hamboy on Saturday, December 01, 2007 11:44 AM>
|
|
|
|
TNO
-
Total Posts
:
2094
- Scores: 36
-
Reward points
:
0
- Joined: 12/18/2004
- Location: Earth
-
Status: offline
|
RE: Opening new tab/browser in Javascript
Saturday, December 01, 2007 11:37 PM
( permalink)
hold on a sec..is this an HTML Application or a webpage?
To iterate is human, to recurse divine. -- L. Peter Deutsch
|
|
|
|
hamboy
-
Total Posts
:
92
- Scores: 6
-
Reward points
:
0
- Joined: 7/11/2005
-
Status: offline
|
RE: Opening new tab/browser in Javascript
Sunday, December 02, 2007 7:06 AM
( permalink)
not sure what you mean by "html app or webpage", but I 'll be storing variables from the current form, and on the side, go to another webpage to fill in that webpage's form, with the variables I stored. I wanted to make this process look automatic, by not showing the second website, and what' it's doing.
|
|
|
|