popup and document.write problem in IE

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

  1. #1
    i would like to popup a window and document.write with javaScript.
    The following works fine on FF, Safari, NS, both on Mac and PC, but fails in IE (6 and 7 as far as i know).
    it opens a new window in IE, but it doesn't write anything. not even title.
    any suggestion?


    paramaters are

    Pic = 'pic1.jpg'
    wVal = 500
    hVal = 500
    Name= 'nw_one'
    pTitle= 'picture 1'

    (new window opens in 500 x500.)

    (this is written in xsl, i don't think it matters. )

    
    	<script language="JavaScript">
    	<![CDATA[
    	
    	
    	function image(Pic,wVal,hVal,pTitle,Name){
    	
    	subWin = window.open("",Name,"width="+ wVal + ",height=" + hVal +",top=0,left=0");
    	subWin.document.open();
    	subWin.document.write('<html><head><title>'+pTitle+'</title>');
    	subWin.document.write('</head><body background="'+ Pic +'">');
    	subWin.document.write('</body></html>');
    	subWin.document.close();
    	subWin.focus();
    
    	
    	}
    	]]>
    	</script>
    
    
    HTML:


    thanx or your help.:):):)
     
    deluxmilkman, Sep 26, 2007 IP
  2. Logic Ali

    Logic Ali Well-Known Member

    Messages:
    170
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    108
    #2
    If you're passing the parameters in the order stated, it won't accept a space in the Name parameter. Can you check that?
     
    Logic Ali, Sep 26, 2007 IP
  3. code-rush

    code-rush Guest

    Messages:
    25
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I agree with Logic Ali.

    IE has a problem if you add space(s) in the name field of a popup window.
     
    code-rush, Oct 1, 2007 IP