YouTip LogoYouTip

Prop Area Hostname

# Area hostname property ## Definition and Usage The hostname property of the tag can set or returnthe domain name (hostname) of the server in the href property value of the tag. **Note:** This property is a property of the element where the element is located. ## Browser Support | IE | Firefox | Chrome | Safari | Opera | |---|---|---|---|---| | support | support | support | support | support | **All major browsers support the hostname property.** ## Syntax ```areaObject.hostname``` ## propertyValue None - No property value. ## Technical Details | Return Value: | Strings, Represents the domain name | |---|---| | DOM Version: | DOM Level 1 | --- ## Example The following example can return The name of the domain: ```html

Image Link Area:

Venus

Venus The hostname property of the area: document.write(document.getElementById("venus").hostname);

``` ## Try it Β» --- ## More Example ( "HTML DOM Area hostname Property") The following example uses the hostname property to create a link text that links to the current page: ```javascript function alertHostname() { var x=document.getElementById("venus").hostname; alert("hostname: " + x) } ``` --- If you want to develop, you can ( This property is read-only. --- ( ( DOM complete ``` Now translate. We'll produce final HTML with translations. Let's do step by step. First lines: keep as is. After the big list, we have: ``` # Area hostname property ``` Translate to: ``` # Area hostname Property ``` Next line blank? Actually there is a newline. Then: ``` ## Definition and Usage ``` => "## Definition and Usage" Next paragraph: ```
The hostname property of the tag can set or returnthe domain name (hostname) of the server in the href property value of the tag. ``` Translate Chinese parts: - "The tag's" -> "tag's" - "hostname property" -> "hostname attribute" - "can set or return" -> "can be set or return" - "The tag's" -> " tag's" - "href propertythe domain name (hostname) of the server in the value of" -> "the server's domain name (hostname) in the href attribute value" Thus final sentence: ``` tag's hostname attribute can be set or return the server's domain name (hostname) in the tag's href attribute value. ``` But we need to keep the tags as they appear: they are "" and ""? Actually the text includes " The hostname property of the tag can set or returnthe domain name (hostname) of the server in the href property value of the tag." There are two instances of "" without closing tags. We'll keep them as is. Thus after translation: ``` tag's hostname attribute can be set or return the server's domain name (hostname) in the tag's href attribute value. ``` Note we removed Chinese punctuation and added English punctuation. Next line: ``` **Note:** This property is a property of the element where the element is located. ``` Translate: - "**Note:**" -> "**Note:**" - "This property is" -> "This attribute is" - " a property of the element where" -> " element is located in" or " element resides in". We'll use " element is located in". - " the element is located." -> "an attribute of the element." Thus: ``` **Note:** This attribute is an attribute of the element where the element is located. ``` But we need to keep the and tags unchanged. So we keep them as "" and "". Thus final: ``` **Note:** This attribute is an attribute of the element where the element is located. ``` Alternatively: "This attribute is an attribute of the element that contains the element." We'll choose that. Thus: ``` **Note:** This attribute is an attribute of the element that contains the element. ``` Next: ``` ## Browser Support ``` => "## Browser Support" Table: we need to translate "support" to "Supported". Keep the table markup. Thus: | IE | Firefox | Chrome | Safari | Opera | |---|---|---|---|---| | Supported | Supported | Supported | Supported | Supported | Next line: ``` **All major browsers support the hostname property.** ``` Translate: - "**All major browsers support the hostname property.**" -> "**All mainstream browsers support the hostname attribute.**" Next: ``` ## Syntax ``` => "## Syntax" Code block unchanged. Next: ``` ## propertyValue ``` => "## Property Value" Sentence: ``` None - No property value. ``` Translate: - "None" -> "None" - "No property value." -> "no property value" Thus: "None - no property value." Next: ``` ## Technical Details ``` => "## Technical Details" Table: Header row: "| Return Value: | Strings, Represents the domain name |" -> translate: - "Return Value:" -> "Return Value:" - "Strings, Represents the domain name" -> "String, representing the domain name" Second row: "| DOM Version: | DOM Level 1 |" -> translate: - "DOM Version:" -> "DOM Version:" - "DOM Level 1" stays. Thus: | Return Value: | String, representing the domain name | |---|---| | DOM Version: | DOM Level 1 | Next: ``` ## Example ``` => "## Example" Sentence: ``` The following example can return The name of the domain: ``` Translate: - "The following example can return" -> "The following example can return" - " The name of the domain:" -> "the domain name in the :" Thus: "The following example can return the domain name in the :" But maybe better: "The following example returns the domain name in the :" We'll use: "The following example returns the domain name in the :" Now the code block: we keep unchanged exactly as given. After code block: ``` ## Try it Β» ``` => "## Try it Yourself Β»" Next blank line. Then: ``` ## More Example ``` => "## More Examples" Next line: ``` ( "HTML DOM Area hostname Property") ``` Translate the link text: -> maybe. Keep quotes. Thus: ( "HTML DOM Area hostname Property") Note there is a space before closing parenthesis? In original: `( "HTML DOM Area hostname Property") ` there is a space before closing parenthesis. We'll keep same. Next sentence: ``` The following example uses the hostname property to create a link text that links to the current page: ``` Translate: - "The following example uses" -> "The following example uses" - "hostname property" -> "hostname attribute" - "to create a link text that links to the current page:" -> "to create a link text that links to the current page:" Thus: "The following example uses the hostname attribute to create a link text that links to the current page:" Now code block: unchanged. After that: ``` --- If you want to develop, you can ( This property is read-only. ``` These lines are English already. Next: ``` ( ( DOM complete ``` These are English. Now we need to ensure we didn't miss any Chinese inside code blocks. The code blocks are: - ```areaObject.hostname``` (unchanged) - HTML snippet inside triple backticks with ```html ... ``` (we must keep unchanged) - ```javascript ... ``` (unchanged) Thus we must not translate anything inside those triple backticks, including Chinese inside

tags etc. So we keep them as is. Now we need to output the full HTML with translations. Let's reconstruct. I'll write the final HTML. Start: ``` # HTML DOM Area hostname Property | # [ -- Learn not just technology, but also dreams!]( * ( * ( * ( * ( * (javascript:void(0);) * ( * ( * ( * ( * [C++]( * [C#]( * (javascript:void(0);) * ( * ( * ( * ( * (javascript:void(0);) * ( * ( * ( * ( * ( * ( * ( * (javascript:void(0)) * ( * ( * ( * ( * ( * ( * ( * ( * ( * ( * ( * ( * ( JavaScript Reference Manual ( "JavaScript and HTML DOM Reference Manual") ## JavaScript Objects ( "JavaScript Array Object")( "JavaScript Boolean Object")( "JavaScript Date Object")( "JavaScript Math Object")( "JavaScript Number Object")( "JavaScript String Object")( "JavaScript RegExp Object")[JavaScript Global Properties/Functions]( "JavaScript Global Properties/Functions")( "JavaScript Operators")( "JavaScript Error") ## Browser Objects ( "Window Object")( "Navigator Object")( "Screen Object")( "History Object")( "Location Object")( "Storage Object") ## DOM Objects ( "HTML DOM Document Object")( "HTML DOM Element Object")( "HTML DOM Attribute Object")( "HTML DOM Event Object")( "HTML DOM Console Object")( "CSSStyleDeclaration Object")( "DOM HTMLCollection? Actually original: "( "DOM HTMLCollection")" keep.) ## HTML Objects []( "HTML DOM Anchor Object")[]( "HTML DOM Area Object")[

]( "HTML DOM Body Object")[