1 / 18

Browser and Server Models

Learn about the key elements of browser and server models for web programming, including Window Object, Event Object, Document Object, Form Object, Application Object, Request Object, and Response Object. Explore methods, properties, collections, and examples for each model.

Télécharger la présentation

Browser and Server Models

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Browser and Server Models Jim Fawcett CSE686 - Internet Programming Spring 2011

  2. Topics • Web Programming Model • Browser Model • Server Model

  3. Window Object • Used to obtain information about: • the state of a browser window • the document in a window • Window events • Summary • Properties: parent, screenLeft, …. • Methods: open, resizeBy, … • Collections: frames • Events: onError, onLoad, … • Objects: event, document, external, screen, … • Example: cse686/lecture2/DHTMLex1.htm

  4. Event Object • Event objects provide information about events on a web page. • Summary • Properties: altKey, button, clientX, keyCode, … • Methods: none • Collections: bookmarks, (data) boundElements • Events: none • Example: cse686/lecture2/DHTMLex2.htm

  5. Document Object • Represents the HTML document in a browser window • Summary • Properties: BGCOLOR, DIR • Methods: attachEvent, createElement, … • Collections: all, children, images, … • Events: onclick, ondrag, … • Example: cse686/lecture2/DHTMLex3.htm

  6. Form Object • Used to collect and display user information, validate input, and send data to a web server. • Summary • Properties: action, firstChild, method, … • Methods: submit, … • Collectons: all, elements, … • Events: onkeydown, onsubmit, … • Example: cse686/lecture2/DHTMLex4.htm

  7. Application Object • Share information between all users of your web site. • Summary • Properties: None • Methods: Contents.Remove, Contents.RemoveAll, Lock, Unlock • Collections: Contents, StaticObjects • Events: OnEnd, OnStart

  8. Request Object • Retrieve information from the current user. • Access all information in the HTTP request. • Used to extract data from a form or URL parameters. • Summary • Properties: Total bytes • Methods: BinaryRead • Collections: ClientCertificate, Cookies, Form, QueryString, ServerVariables • Events: None • Example: see DHTMLex4.asp handout

  9. Response Object • Return information to the user’s browser. • Summary • Properties: Buffer, CacheControl, Charset, ContentType, Expires, ExpiresAbsolute, IsClientConnected, PICS, Status • Methods: AddHeader, AppendToLog, BinaryWrite, Clear, End, Flush, Redirect, Write • Collections: Cookies • Events: None • Example: cse686/lecture2/ASPex1.asp • Example:cse686/lecture2/ASPex2.asp

  10. Server Object • Determine server specific properties. • Load ActiveX dlls • Summary • Properties: ScriptTimeout • Methods: CreateObject, Execute, GetLastError, HTMLEncode, MapPath, Transfer, URLEncode • Events: None • Example: cse686/lecture2/ASPex5.asp

  11. Session Object • Saves information about the current user as cookies on the client machine. • Summary • Properties: CodePage, LCID, SessionID, Timeout • Methods: Abandon, Contents.Remove, Contents.RemoveAll • Collections: Contents, StaticObjects • Events: Session_OnEnd, Session_OnStart

  12. Server Component Objects • Dictionary Object • FileSystemObject Object • AdRotator Component • Browser Capabilities Component • Content Linking Component • ActiveX Data Objects

  13. Dictionary Object • Create Dictionary Object • Set objDict = _ Server.CreateObject(“Scripting.Dictionary”) • Add item: objDict.Add key, value • objDict.Add “Name” “Jim Fawcett” • objDict.Add “Employer” “Syracuse Univ” • Size: objDict.Count • Item: objDict.Item(key) • Example: cse686/lecture2/ASPex3.asp

  14. FileSystemObject Object • Create FileSystemObject: • Set objFile = _ Server.CreateObject(“Scripting.FileSystemObject”) • List Drives: • For Each sDrive In objFile.Drives Response.Write sDrive & “ “ • Get Drive: • Set cDrive = objDrive.GetDrive(“C”) • Get Root Folder: • Set cRoot = cDrive.RootFolder • List Files: • For Each sFile In cRoot.Files Response.Write sFile & “<br />” • Example: cse686/lecture2/ASPex4.asp

  15. End of Presentation

More Related