You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
59 lines
2.4 KiB
59 lines
2.4 KiB
<HTML>
|
|
<HEAD>
|
|
<META NAME="GENERATOR" Content="Microsoft Developer Studio">
|
|
<META HTTP-EQUIV="Content-Type" content="text/html; charset=iso-8859-1">
|
|
<TITLE>Document Title</TITLE>
|
|
<OBJECT ID=pchealth classid=CLSID:FC7D9E02-3F9E-11d3-93C0-00C04F72DAF7></OBJECT>
|
|
</HEAD>
|
|
<BODY>
|
|
|
|
</BODY>
|
|
|
|
<SCRIPT>
|
|
|
|
debugger;
|
|
var th = pchealth.TextHelpers;
|
|
|
|
var out = th.QuoteEscape( "string \"with\" ' quote" );// The default is escaping the double quote.
|
|
// RESULT: string \"with\" ' quote
|
|
|
|
var out = th.QuoteEscape( "string \"with\" ' quote", "'" );
|
|
// RESULT: string "with" \' quote
|
|
|
|
|
|
var out = th.URLUnescape( "hcp://CN=Microsoft%20Corporation,L=Redmond,S=Washington,C=US/offlinedc.htm" );
|
|
// RESULT: hcp://CN=Microsoft Corporation,L=Redmond,S=Washington,C=US/offlinedc.htm
|
|
|
|
var out = th.URLUnescape( "URL=hcp%3A//system/tests/test_cabinet.htm&TITLE=test+test", true ); // Apply special rules for query strings.
|
|
// RESULT: URL=hcp://system/tests/test_cabinet.htm&TITLE=test test
|
|
|
|
var out = th.URLEscape( "hcp://CN=Microsoft Corporation,L=Redmond,S=Washington,C=US/offlinedc.htm" );
|
|
// RESULT: hcp%3A//CN%3DMicrosoft%20Corporation%2CL%3DRedmond%2CS%3DWashington%2CC%3DUS/offlinedc.htm
|
|
|
|
var out = th.URLEscape( "Some text with illegal characters: + = & ?", true ); // Apply special rules for query strings.
|
|
// RESULT: Some+text+with+illegal+characters%3A+%2B+%3D+%26+%3F
|
|
|
|
var out = th.HTMLEscape( "Some text with illegal characters for HTML: + = & ?" );
|
|
// RESULT: Some text with illegal characters for HTML: + = & ?
|
|
|
|
var pu = th.ParseURL( "hcp://system/errors/notfound.htm?URL=hcp%3A//system/tests/test_cabinet.htm&TITLE=A+title" );
|
|
|
|
var out = pu.BasePart;
|
|
// RESULT: hcp://system/errors/notfound.htm
|
|
|
|
var lst = pu.QueryParameters; // Safe array of the query parameters.
|
|
var arr = (new VBArray( lst )).toArray(); // Converted to a Javascript array.
|
|
|
|
var title = pu.GetQueryParameter( "TITLE" ); // RESULT: "A title"
|
|
var url = pu.GetQueryParameter( "URL" ); // RESULT: "hcp://system/tests/test_cabinet.htm"
|
|
var other = pu.GetQueryParameter( "MISSING" ); // RESULT: undefined
|
|
|
|
pu.SetQueryParameter( "URL", "http://www.microsoft.com" );
|
|
pu.DeleteQueryParameter( "TITLE" );
|
|
|
|
var newUrl = pu.BuildFullURL();
|
|
// RESULT: "hcp://system/errors/notfound.htm?URL=http%3A//www.microsoft.com"
|
|
|
|
</SCRIPT>
|
|
|
|
</HTML>
|