window.open title problem on safari.

Discussion in 'JavaScript' started by deluxmilkman, Sep 22, 2007.

  1. #1
    when i open a new window, title shows "untitled" on safari.
    works on FireFox and Netscape.
    thanks

    
    
    	<head>
    		<title>test</title>
    		<script language="JavaScript">
    	
    	function image(Pic,wVal,hVal){
    	subWin = window.open("","subwindow","width="+ wVal + ",height=" + hVal +",top=0,left=0");
    	subWin.document.open();
    	subWin.document.write('<html><head><title>image</title></head><body background="'+ Pic +'"></body></html>');
    	subWin.document.close();
    	
    	}
    	
    	</script>
    	</head>
    	<body><a href="javascript:void(0)" onClick="image('pic1.jpg',400,400)"><img src="thumb1.jpg"></a>
    	</body>
    
    HTML:

     
    deluxmilkman, Sep 22, 2007 IP
  2. krt

    krt Well-Known Member

    Messages:
    829
    Likes Received:
    38
    Best Answers:
    0
    Trophy Points:
    120
    #2
    It probably doesn't bother checking to see if the title has changed when you add HTML. But you already have a JS dependency so why not just change document.title?
     
    krt, Sep 22, 2007 IP