home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 February / CHIP_2_98.iso / software / pelne / optionp / iis4_06.cab / samp4m7b.asp < prev    next >
Text File  |  1997-10-03  |  3KB  |  40 lines

  1.  <% If Request("DontFrame")<>1 Then Response.Redirect "/iissamples/sdk/asp/docs/SampFram.asp?ovfile=/iishelp/iis/htm/sdk/samp4m7b.asp&srcfile=Interaction/ClientScript" %>
  2. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
  3. <HTML>
  4. <HEAD>
  5. <META HTTP-EQUIV="Content-Type" Content="text-html; charset=Windows-1252">
  6. <title>Client-Side Scripting</title>
  7. <script language="JavaScript">
  8.  
  9.     szNavVersion = navigator.appVersion
  10.  
  11.     if (navigator.appName == "Microsoft Internet Explorer") {
  12.     if (szNavVersion.indexOf ("4.") >= 0) {
  13.         document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/spidie4.css">');
  14.     } else {
  15.         document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/spidie3.css">');
  16.     }
  17.     }
  18.     else if (navigator.appName == "Netscape") {
  19.     document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/spidie4.css">');
  20.     }
  21.     else {
  22.     document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/spidie3.css">');
  23.     }
  24.  
  25. </script>
  26. <META NAME="DESCRIPTION" CONTENT="Internet Information Server reference information"></HEAD>
  27. <BODY BGCOLOR=#FFFFFF TEXT=#000000>
  28. <font face="Verdana, Arial, Helvetica">
  29. <h3><a name="_client_side_scripting"></a>Client-Side Scripting</h3>
  30. <p>
  31. ASP is a server-side scripting environment. Client-side scripting complements ASP nicely, allowing for a number of enhancements, such as ActiveXÖ controls, that can make your application more powerful and user-friendly.</p>
  32. <p>
  33. This example demonstrates how you can include a client-side script in your language. This script defines a subroutine called <b>DoIt</b> within the <SCRIPT> tags. Notice that there is not a RUNAT=SERVER attribute present, which would indicate that the script is an ASP subroutine. The page provides one button for the user that, when clicked, executes the <b>DoIt</b> subroutine on the client browser. </p>
  34. <p>
  35. This sample demonstrates a very useful advantage to combining ASP scripts with client-side scripting. When ASP encounters the <SCRIPT> tags, it does not simply ignore everything within that block. It continues to search for, parse, and execute script elements, specified with delimiters (<% ... %>), that are meant for the server. This example, therefore, returns the session information returned from the <b>Session.SessionID</b> method within a client-side script. </p>
  36. <hr class="iis" size="1">
  37. <p align="center"><em><a href="/iishelp/common/colegal.htm">© 1997 by Microsoft Corporation. All rights reserved.</a></em></p>
  38. </BODY>
  39. </HTML>
  40.