Leaked source code of windows server 2003
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

  1. <HTML>
  2. <HEAD>
  3. <META NAME="GENERATOR" Content="Microsoft Developer Studio">
  4. <META HTTP-EQUIV="Content-Type" content="text/html; charset=iso-8859-1">
  5. <TITLE>Document Title</TITLE>
  6. <OBJECT ID=pchealth classid=CLSID:FC7D9E02-3F9E-11d3-93C0-00C04F72DAF7></OBJECT>
  7. </HEAD>
  8. <BODY>
  9. </BODY>
  10. <SCRIPT>
  11. debugger;
  12. var th = pchealth.TextHelpers;
  13. var out = th.QuoteEscape( "string \"with\" ' quote" );// The default is escaping the double quote.
  14. // RESULT: string \"with\" ' quote
  15. var out = th.QuoteEscape( "string \"with\" ' quote", "'" );
  16. // RESULT: string "with" \' quote
  17. var out = th.URLUnescape( "hcp://CN=Microsoft%20Corporation,L=Redmond,S=Washington,C=US/offlinedc.htm" );
  18. // RESULT: hcp://CN=Microsoft Corporation,L=Redmond,S=Washington,C=US/offlinedc.htm
  19. var out = th.URLUnescape( "URL=hcp%3A//system/tests/test_cabinet.htm&TITLE=test+test", true ); // Apply special rules for query strings.
  20. // RESULT: URL=hcp://system/tests/test_cabinet.htm&TITLE=test test
  21. var out = th.URLEscape( "hcp://CN=Microsoft Corporation,L=Redmond,S=Washington,C=US/offlinedc.htm" );
  22. // RESULT: hcp%3A//CN%3DMicrosoft%20Corporation%2CL%3DRedmond%2CS%3DWashington%2CC%3DUS/offlinedc.htm
  23. var out = th.URLEscape( "Some text with illegal characters: + = & ?", true ); // Apply special rules for query strings.
  24. // RESULT: Some+text+with+illegal+characters%3A+%2B+%3D+%26+%3F
  25. var out = th.HTMLEscape( "Some text with illegal characters for HTML: + = & ?" );
  26. // RESULT: Some text with illegal characters for HTML: + = &amp; ?
  27. var pu = th.ParseURL( "hcp://system/errors/notfound.htm?URL=hcp%3A//system/tests/test_cabinet.htm&TITLE=A+title" );
  28. var out = pu.BasePart;
  29. // RESULT: hcp://system/errors/notfound.htm
  30. var lst = pu.QueryParameters; // Safe array of the query parameters.
  31. var arr = (new VBArray( lst )).toArray(); // Converted to a Javascript array.
  32. var title = pu.GetQueryParameter( "TITLE" ); // RESULT: "A title"
  33. var url = pu.GetQueryParameter( "URL" ); // RESULT: "hcp://system/tests/test_cabinet.htm"
  34. var other = pu.GetQueryParameter( "MISSING" ); // RESULT: undefined
  35. pu.SetQueryParameter( "URL", "http://www.microsoft.com" );
  36. pu.DeleteQueryParameter( "TITLE" );
  37. var newUrl = pu.BuildFullURL();
  38. // RESULT: "hcp://system/errors/notfound.htm?URL=http%3A//www.microsoft.com"
  39. </SCRIPT>
  40. </HTML>