Launch and Open Links in New Window or Tab with _blank or _new as Target in HTML and Their Difference啟動和打開鏈接在新窗口或標籤與_blank或_new為目標的HTML和他們的差異
On most websites, publishers may prefer to open the links to other web pages, especially external links that open web pages out of their own sites, in a new web browser window or tab, as most of the time, clicking on a link will load the new document from the link in the same window with where the link was.在大多數網站,出版商可能更喜歡打開鏈接到其他網頁,尤其是外部鏈接的網頁上公開了自己的網站,在一個新的網絡瀏覽器窗口或標籤,因為大多數時間裡,點擊一個鏈接將負載新文件的鏈接在同一窗口的聯繫。 In HTML web programming language, to launch the new document (web pages) from links in a new window or tab effect is typically done through the use of target attributes on those links.在HTML網頁編程語言,推出新的文件(網頁)的鏈接在新窗口或標籤效應通常是通過使用對象屬性的聯繫。
In this case, the link anchors will be using “_blank” as the value of the “target” attribute.在這種情況下,鏈接錨將使用“ _blank ”做為價值的“目標”的屬性。 “_blank” tells the web browser to open the new document loaded from the link in a new window. “ _blank ”講述了網頁瀏覽器打開新文件加載的鏈接在一個新窗口。 “target” attribute is also used in websites with frame structure to tell the web browser which frame the target page of a link should open when click. “目標”的屬性,也可以使用網站的框架結構,告訴瀏覽器這幀目標網頁的鏈接時,應打開點擊。 However, “_blank” does not require the use of any frames.然而, “ _blank ”並不需要使用任何時限。 The syntax or HTML code is typically as below:語法或HTML代碼通常如下:
<a href=”newwindow.html” target=”_blank”>New Window</A>的<a href="newwindow.html" target="_blank">新視窗“ /阿”
There are also publishers who use “_new” instead of “_blank” as the value for “target” attribute to open a link in new window.也有出版商誰使用“ _new ”而不是“ _blank ”做為價值的“目標”屬性打開一個鏈接在新窗口中。 There is actually no “_new” defined as frame target names by W3C HTML standards.因此實際上是沒有“ _new ”界定為框架的目標名稱的W3C的HTML標準。 The only four reserved names are “_blank”, “_parent”, “_self” and “_top”.只有四個保留的名稱是“ _blank ” , “ _parent ” , “ _self ”和“ _top ” 。 However, the “_new” value works the same way as “_blank” to launch the linked web documents in new browser window because of graceful error handling by web browsers.然而, “ _new ”價值工程以同樣的方式為“ _blank ”推出的網頁鏈接文件的新瀏覽器窗口,因為優美的錯誤處理的網頁瀏覽器。 So “_new” is not a valid value for “target” attribute in link <a> anchor, and may cause inconsistent behaviour for strictly HTML compliant browser that ignores all other target names as frame target name should begin with an alphabetic character (az and AZ).因此, “ _new ”不是有效的值為“目標”屬性鏈接請<a>錨,並可能會導致不一致的行為,嚴格的HTML的瀏覽器,無視所有其他目標的名字作為框架的目標名稱應以字母開頭( az和亞利桑那州) 。
When “_new” is used, the web browser will look for an existing browser window that carries the “_new” handle name.當“ _new ”的使用,網頁瀏覽器將尋找一個現有的瀏覽器窗口中開展了“ _new ”處理的名稱。 If there is none then browser will create and launch the target web document at new window (or new tab in browser that supports tabbed browsing), where browser is considered to be recovering from HTML error of targeting a non-existent window.如果沒有那麼瀏覽器將創建和推出的目標網頁文件在新的視窗(或新標籤瀏覽器,支持分頁瀏覽) ,在瀏覽器被認為是從HTML錯誤的目標是不存在的窗口。 In this case, the new window will be named “_new”.在這種情況下,新的窗口將被命名為“ _new ” 。 However, if a window or a tab with “_new” handle already existed, the target page will be loaded into that window instead.但是,如果一個窗口或一個標籤與“ _new ”處理已經存在,目標網頁將加載到該窗口代替。 Theoretically, you no need to use “_new” as the value for “target”, as any other value name (ie “newwindow” or “newtab”) will work to create a new window if the so named window hasn’t existed yet when clicked on the link.從理論上講,你沒有必要使用“ _new ”作為價值的“目標” ,因為任何其他值的名稱(即“ newwindow ”或“ newtab ” )將致力於創建一個新的窗口,如果這樣命名窗口已不存在尚未當點擊了鏈接。
In other word, if you want the links to open in a new window on every click, use the “_blank”.在其他詞,如果你想鏈接在新窗口中打開的每一次點擊,使用“ _blank ” 。 And you can use “_new” or another other valid value name starting with alphabetic character to open a new window and re-use that window for any other subsequent clicks that target to the same name.您可以使用“ _new ”或另一種有效的值的名稱從字母,以打開一個新窗口,並重新使用該窗口用於其他任何隨後點擊這個目標,以相同的名稱。
IMPORTANT : This is a machine translated page which is provided "as is" without warranty. 重要說明:這是一台機器翻譯網頁這是“原樣”提供,無保修。 Machine translation may be difficult to understand.機器翻譯可能很難理解。 Please refer to請參閱 original English article英文原文的文章 whenever possible.只要有可能。
Share and contribute or get technical support and help at共享和貢獻或獲得技術支持和幫助 My Digital Life Forums 我的數字生活論壇 . 。
Related Articles相關文章
- How to Open and View or Extract CHM (Compiled HTML) Files in Linux如何打開並查看或中草藥提取物(已編譯的HTML )的文件在Linux
- How to Open Links in New Tab in Safari如何打開鏈接在新標籤在Safari
- Add Open Command Window Here to XP Folder with PowerToy購買開放命令窗口這裡XP中文件夾PowerToy
- Open Elevated Command Prompt Window Here as Administrator at Current Folder Directly in Vista Windows Explorer開放高架命令提示窗口這裡作為管理員在當前文件夾直接在Vista中Windows檔案總管
- Create Symbolic Links, Hard Links and Directory Junctions in Vista with MKLINK創建符號鏈接,硬鏈接和目錄結在Vista與MKLINK
- Solution: Transfer from Window XP to Window Vista解決方案:轉移窗口XP的Vista的窗口
- Difference Between XP and Vista on Arrangement Sequence Start Menu Recent Programs區別XP和Vista序列的安排,最近開始菜單程序
- Another Target for Identity Theft - Photocopiers另一個目標的身份盜竊-複印機
- HTML Color Names HEX Codes Chart Table HTML顏色的十六進制代碼名稱表圖
- Trick to Add AdSense, AdBrite and Other JavaScript Ad Code Directly to Blogger HTML Template伎倆將AdSense新增, AdBrite和其他的JavaScript廣告代碼直接到Blogger的HTML模板


























July 9th, 2007 23:27 2007年7月9號23:27
thank you…感謝你...
December 24th, 2007 12:41 2007年12月24號12:41
Great Post!偉大的郵政! Important piece of information.重要信息。
April 10th, 2008 13:42 2008年4月一十日13:42
Your blog is so helpful.您的博客是有益的。 Thank you.謝謝您。
November 7th, 2008 19:55 08年11月7號19:55
Very helpful.非常有幫助。 Wondering if there’sa way to provide some sort of command to make the URL open in a tab only.如果有想知道的方式提供某種形式的命令作出的網址打開一個標籤只。
Any thoughts or knowledge is most appreciated!任何思想或知識是最讚賞!