scopeName property
Gets the namespace defined for the element.
This property is not supported for Windows Store apps using JavaScript.
Syntax
JavaScript |
p = object.scopeName |
Property values
Type: String
A String that specifies one of the following values.
HTML
Default. All standard HTML tags.
scope
Namespace prefix that is used with the custom tags. This namespace is declared in the document by using the XMLNS attribute of the html element.
Remarks
To declare the namespace in the document, use the xmlns attribute of the html element.
Download the HTC for the sample below: simple.htc
Examples
This example shows the values that are returned by the scopeName and tagUrn properties when they are used with a simple HelloWorld custom tag. The browser's status bar displays the property values.
Note For IE8Standards mode to render correctly, make sure there is no spaces in your call to the HTC file.
Code example: http://samples.msdn.microsoft.com/workshop/samples/author/dhtml/refs/tagUrn.htm
<html xmlns:InetSDK='https://msdn.microsoft.com/workshop'>
<style>
@media all {
InetSDK\:HelloWorld { behavior:url(simple.htc) }
}
</style>
<script type="text/javascript">
function window.onload()
{
window.status = 'scopeName = ' + hello.scopeName +
'; tagUrn = ' + hello.tagUrn;
}
</script>
<body>
<InetSDK:HelloWorld ID='hello'></InetSDK:HelloWorld>
</body>
</html>
An alternative call to the HTC can also be made as an attribute:
Note Again, there should be no spaces in your style's declaration.
<html XMLNS:InetSDK='https://msdn.microsoft.com/workshop'>
<script>
function window.onload()
{
window.status = 'scopeName = ' + hello.scopeName +
'; tagUrn = ' + hello.tagUrn;
}
</script>
<body>
<InetSDK:HelloWorld ID='hello' style="behavior:url(simple.htc)"></InetSDK:HelloWorld>
</body>
</html>