Opening new tab/browser in Javascript

Author Message
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)
0
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
 

 
#1
    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)
    0
    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
     
    #2
      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)
      0
      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>
       
      #3
        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)
        0
        hold on a sec..is this an HTML Application or a webpage?
        To iterate is human, to recurse divine. -- L. Peter Deutsch
         
        #4
          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)
          0
          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.
           
          #5

            Online Bookmarks Sharing: Share/Bookmark

            Jump to:

            Current active users

            There are 0 members and 1 guests.

            Icon Legend and Permission

            • New Messages
            • No New Messages
            • Hot Topic w/ New Messages
            • Hot Topic w/o New Messages
            • Locked w/ New Messages
            • Locked w/o New Messages
            • Read Message
            • Post New Thread
            • Reply to message
            • Post New Poll
            • Submit Vote
            • Post reward post
            • Delete my own posts
            • Delete my own threads
            • Rate post

            2000-2012 ASPPlayground.NET Forum Version 3.9