Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

back\slash

Status
Not open for further replies.

lalzad

IS-IT--Management
Nov 29, 2006
15
CA
why do we need 2 backslashes when loading a document.
<html>
<head>
<title>MSXML load example</title>
<script>
function showXML() {
alert("The document element of the document is named : \n" +
objXMLDOM.documentElement.nodeName);
}
</script>
<head>
<body>
<p>This example tests the <b>load( )</b> method.</p>
<script language="JScript" type="text/javascript">
try {

var objXMLDOM = new ActiveXObject ( "Msxml2.DOMDocument.3.0" ) ;
objXMLDOM.load("C:\\saxon\\School\\xml\\beg\\ch11\\SimpleDoc.xml") ;

//If no exception is raised MSXML 3 is installed.
document.write("MSXML 3 is installed on your machine.") ;

}

// If there is an exception it could be a coding error but
// it is likely that MSXML 3 is not installed.
catch (e)
{
document.write("MSXML 3 is NOT installed on your machine.");
}
</script><br /><br />
<input type="button" value="Click here to show XML" onclick="showXML()" />
</body>
</html>
 
Because the first backslash is an escape character telling the computer to take the next character after. If the next character is a character like the backslash, it treats the second backslash as a literal character.

Paths in directories use backslashes to navigate though directories.

[monkey][snake] <.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top