2010-03-13 5 views

Répondre

2

De MDC on window.open()

window.open(strUrl, strWindowName [, strWindowFeatures]); 

strWindowName
C'est la chaîne d'identification de la nouvelle fenêtre. Cette chaîne peut être utilisée pour être la cible des liens et des formulaires lorsque l'attribut cible d'un <a> élément ou d'un <form> est spécifié. Ce paramètre de chaîne ne doit pas contenir tout espace vide. strWindowName ne spécifie pas le titre de la nouvelle fenêtre .

4
windowName 

Un nom à donner à la nouvelle fenêtre. Le nom peut être utilisé pour renvoyer cette fenêtre. Après l'ouverture de la fenêtre, vous voudrez faire toutes sortes de choses avec elle, par exemple. déplacer alors vous pouvez faire

<html> 
<head> 
<title>Window Example</title> 
</head> 
<SCRIPT language="JavaScript1.2"> 
function poponload() 
{ 
    testwindow= window.open ("", "mywindow"); 
    alert('I will move window to 0,0'); 
    testwindow.moveTo(0,0); 
} 
</SCRIPT> 
<body onload="javascript: poponload()"> 
<H1>Window Example</H1> 
</body> 
</html> 

Et NO son pas window title ses différents.

-source

2

De l'documentation:

sName

Optional. String that specifies the name of the window. This name is used 
as the value for the TARGET attribute on a form or an anchor element. 

_blank 
    The sURL is loaded into a new, unnamed window. 
_media 
    The url is loaded in the Media Bar in Microsoft Internet Explorer 6. 
    Windows XP Service Pack 2 (SP2) and later. This feature is no longer 
    supported. By default the url is loaded into a new browser window or 
    tab. 
_parent 
    The sURL is loaded into the current frame's parent. If the frame has 
    no parent, this value acts as the value _self. 
_search 
    Disabled in Windows Internet Explorer 7, see Security and Compatibility 
    in Internet Explorer 7 for details. Otherwise, the sURL is opened in the 
    browser's search pane in Internet Explorer 5 or later. 
_self 
    The current document is replaced with the specified sURL. 
_top 
    sURL replaces any framesets that may be loaded. If there are no framesets 
    defined, this value acts as the value _self. 
+0

Je crois que ces noms "spéciaux" ne sont pas applicables à l'open() - méthode, seule cible attributs . Sinon, cela signifierait qu'un ciblage open() _self serait identique à la définition de location.href. – jishi

+0

Fait intéressant, cela semble être le cas dans FF 3.6. – jishi

Questions connexes