Results 1 to 5 of 5

Thread: Javascript question

  1. Javascript question

    My knowledge of Javascript has always been shaky, but in any case... I need some help. Im trying to implement a file attachment system/interface similar to the vBulletin one, and right now I nearly got it done. All I need to do now is put some javascript into the pop-up window to (A) close the window, and (B) load the window underneath it with another page. Does anyone know how to do that? Thanks!

  2. Code:
    <s.cript language="Javascript">
    function showit() {
    	PopUp = window.open("", "MyNewPopup", "dependent=1,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,width=200,height=100,top=15,left=15")
    	PopUp.document.write ("<form><INPUT ONCLICK=\"window.opener.location.href='http://www.microsoft.com'\" type=\"button\" value=\"Goto Microsoft\"><INPUT ONCLICK='window.close()' type='button' value='Close Me'></form>")
    	PopUp.document.close()
    	if ( window.setTimeout )
    		window.setTimeout("PopUp.focus()", 250)
    	return false
    }
    </s.cript>
    <form><input onclick="showit()" type="button" value="show it"></form>
    I think this is what you want. Throw that code into a test.html file, and fix the spelling on the script tags to test it. When you open it, you'll have one button to show a popup window. The popup window has 2 buttons. One closes it, the other makes the main(parent) window that opened it go to microsoft's site. There ya go.

    Here goes a starter for beginner's level: http://www.chalcedony.com/javascript/scripts/index.html
    Last edited by NightWolve; 22 Jan 2005 at 01:21 PM.

  3. Seems to work fine in IE but not Mozilla 1.7.3.

  4. Use:
    Code:
    <s.cript language="Javascript">
    minus the period again. Just a little pickiness with the others. Did Netscape 7 & FireFox also this time. Input tags technically need to be enclosed in form tags else they won't show up at all in Netscape 4. Anyway, fix your html proper in your leisurely.
    Last edited by NightWolve; 22 Jan 2005 at 01:57 AM.
    "Don't be a pansy." - James

  5. Ok, it works. Thanks. Im gonna have to streamline some of the other work I did but itll make sense in the end.

    edit: I got it working in some test files. Tomorrow Ill put it the actual site code and finish things off. But Ive been working on this junk too long tonight.
    Last edited by diffusionx; 22 Jan 2005 at 02:19 AM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Games.com logo