Results 1 to 3 of 3

Thread: simple javascript question [*RESOLVED*]

  1. #1

    Thread Starter
    <?="Moderator"?> john tindell's Avatar
    Join Date
    Jan 2002
    Location
    Brighton, UK
    Posts
    1,099

    simple javascript question [*RESOLVED*]

    can someone please tell me why im getting an error?

    Code:
    <script language="javascript">
    function openwin(example){
    		switch(example){
    		case "one":
    			newWin=window.open("","newWin","");
    			newWin.document.write("<HTML>");
    			newWin.document.write("	<HEAD>");
    			newWin.document.write("		<TITLE>My New Text</TITLE>");
    			newWin.document.write("	</HEAD>");
    			newWin.document.write("	<BODY>");
    			newWin.document.write("		<FONT FACE=\"Comic Sans MS\">Hello Web!</FONT>");
    			newWin.document.write("	</BODY>");
    			newWin.document.write("<HTML>");
    			break;
    		case "two":
    			newWin=window.open("","newWin","");
    			newWin.document.write("<HTML>");
    			newWin.document.write("	<HEAD>");
    			newWin.document.write("		<TITLE>Aligning Text</TITLE>");
    			newWin.document.write("	</HEAD>");
    			newWin.document.write("	<BODY>");
    			newWin.docuemnt.write("		<DIV ALIGN="Center">Centered Text</DIV>");
    			newWin.document.write("	</BODY>");
    			newWin.document.write("<HTML>");
    			break;
    		}
    		}
    </script>
    im calling it using
    Code:
    <a href="javascript:openwin('one');>click me</a>
    Thanks
    Last edited by john tindell; Dec 24th, 2002 at 03:51 PM.

  2. #2

    Thread Starter
    <?="Moderator"?> john tindell's Avatar
    Join Date
    Jan 2002
    Location
    Brighton, UK
    Posts
    1,099
    me being stupid and all forgot to put \" instead of ".

  3. #3
    Lively Member
    Join Date
    Dec 2002
    Location
    southwest pennsylvania
    Posts
    65
    i hope you caught this:
    <a href="javascript:openwin('one');">click me</a>
    if you choose not to decide you still have made a choice!

    RUSH rocks!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width