javascript programmer''''s reference phần 4 ppt

262 651 0
javascript programmer''''s reference phần 4 ppt

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

F – File extensions (Definition) 783 Extension Description .lha LHArc Archive .lwp Lotus WordPro Document .lzh LHArc Archive .m15 DV Video/MPEG video/audio stream .m1a MPEG audio stream .m1a MPEG video/audio stream .m1s DV Video/MPEG audio stream .m1v MPEG video/audio stream .m2s DV Video .m2v DV Video .m3u MP3 PlayLists .m75 DV Video/MPEG video/audio stream .mac MacPaint Image/PICT Image .mda Microsoft Access Database .mdb Microsoft Access Database .mde Microsoft Access Database .med Amiga OctaMed music .mid MIDI Music .midi MIDI Music .ml ML Source .mocha JavaScript Program .mod Amiga OctaMed music .moov QuickTime Movie .mov QuickTime Movie .mp2 MPEG video/audio stream .mp2v MPEG2 Video .mp3 MPEG-1 Layer 3 audio stream/MPEG Movie .mpa MPEG video/audio stream .mpe MPEG video/audio stream .mpeg MPEG video/audio stream .mpegv MPEG Video .mpg MPEG video/audio stream .mpm MPEG video/audio stream .mpv MPEG video/audio stream .mpv2 MPEG2 Video .msp Animated NeoChrome .mtm 669 MOD Music .mw MacWrite Document Table continued on following page JavaScript Programmer's Reference 784 Extension Description .mwii MacWrite Document .neo Animated NeoChrome .nsc application/x-conference .nst Amiga OctaMed music .obj MS-DOS Executable .oda ODA Document .okt Amiga OctaMed music .or2 Lotus Organizer Document .or3 Lotus Organizer Document .org Lotus Organizer Document .otf OpenType Font .out Untyped Binary Data .ovl MS-DOS Executable .p7c PKCS7 Encrypted Data .p7m PKCS7 Encrypted Data .p7s PKCS7 Signature .pac A proxy or parameter package file (also a NeoChrome image file) .pbm Portable Bitmap .pc1 Animated NeoChrome .pc2 Animated NeoChrome .pc3 Animated NeoChrome .pcd PhotoCD Image .pcs Animated NeoChrome .pct PICT Image .pcx Animated NeoChrome .pdf Portable Document Format .pf Private File .pgm Portable Graymap .pgp PGP Key File .pi1 Animated NeoChrome .pi2 Animated NeoChrome .pi3 Animated NeoChrome .pic PICT Image .pict PICT Image .pit PackIt Archive .pkg AppleLink Package .pl Perl Program .pls MP3 PlayLists Table continued on following page F – File extensions (Definition) 785 Extension Description .plt Animated NeoChrome .pm Animated NeoChrome .pm3 PageMaker 3 Document .pm4 PageMaker 3 Document .pm5 PageMaker 3 Document .png PNG Image .pnm PBM Image .pnt MacPaint Image .pntg OS/2 Bitmap/MacPaint Image .pot Microsoft PowerPoint Show .ppa Microsoft PowerPoint Show .ppm Portable Pixmap .pps Microsoft PowerPoint Show .ppt Microsoft PowerPoint Show .pre Lotus Freelance Document .prz Lotus Freelance Document .ps Postscript Document .psd PhotoShop Document .pt4 PageMaker 3 Document .pt5 PageMaker 3 Document .pwz Microsoft PowerPoint Show .pxr PhotoShop Document .qcp QCP Audio .qdv Animated NeoChrome .qif OS/2 Bitmap .qt QuickTime Movie .qtc video/x-qtc .qti QuickTime Image .qtif QuickTime Image .qxd QuarkXpress Document .qxt QuarkXpress Document .ra RealAudio Clip .ram RealPlayer File .ras CMU Raster Image .raw Animated NeoChrome .rf RealFlash Clip .rgb SGI Image/RGB Image .rgba SGI Image Table continued on following page JavaScript Programmer's Reference 786 Extension Description .rif Animated NeoChrome .rjs RealSystem Skin .rle Animated NeoChrome .rm RealMedia File .rmf audio/rmf/audio/x-rmf .rmm RealPlayer File .rmp RealJukebox Music Package .rmx RealSystem Secure Media Clip .rnx RealPlayer File .rp RealPix Clip .rpl Replica Document .rpm RealPlayer Plugin .rsc Resource File .rsml RealSystem ML File .rsrc Resource File .rt RealText Clip .rtf Rich Text Format File .rts Real Time Streaming Protocol .rtsp Real Time Streaming Protocol .rv RealVideo Clip .s3m 669 MOD Music .sam Lotus WordPro Document .sc2 Microsoft Schedule+ Application .scc Animated NeoChrome .scd Microsoft Schedule+ Application .scg Animated NeoChrome .sch Microsoft Schedule+ Application .sci Animated NeoChrome .scm Lotus ScreenCam Movie .scp Animated NeoChrome .scr Animated NeoChrome .scu Animated NeoChrome .sd2 DV Video .sdp Session Description Protocol/Scalable Multicast .sea Self-Extracting Archive .sf IRCAM Sound .sgi OS/2 Bitmap/SGI Image .sgm SGML Document Table continued on following page F – File extensions (Definition) 787 Extension Description .sgml SGML Document .sh Bourne Shell Program .shar Unix Shell Archive .shp Animated NeoChrome .shtm HTML web page with server-side include .shtml HTML web page with server-side include .sit Macintosh StuffIt Archive .sit StuffIt Archive .six Animated NeoChrome .smf MIDI .smi SMIL Document .smil SMIL Document .snd Amiga OctaMed music .snd AU Audio .snd ULAW Audio .spc Animated NeoChrome .spl FutureSplash Player .sr Animated NeoChrome .ssm Standard Streaming Metafile .stm HTML web page with server side include .sun Animated NeoChrome .sup Animated NeoChrome .svx Amiga OctaMed music .swf Shockwave Flash .tar Unix Tape Archive .targa OS/2 Bitmap/Targa Truevision Image .taz Unix Compressed (.z) Files .tcl TCL Program .tex TeX Document .texi GNU TeXinfo Document .texinfo GNU TeXinfo Document .text Text File .tga OS/2 Bitmap/Targa Truevision Image .tgz GZIP File .tif TIFF Image .tiff TIFF Image .tny Animated NeoChrome .ttc OpenType Font Table continued on following page JavaScript Programmer's Reference 788 Extension Description .ttf OpenType Font .txt Text File .ul AU Audio .ulw AU Audio .url URL Bookmark .uu UUEncoded Data .uue UUEncoded Data .vbs VB Script in text file/MPEG Video .vcf VCard .vew Lotus Approach Document .vff Animated NeoChrome .vfw Microsoft Video .vga OS/2 Bitmap .vob DV Video .voc Amiga OctaMed music .w51 WordPerfect PC 5.1 Doc .waf Website Archive .wav WAV Audio .web Compiled JavaScript and HTML, ready to be served by NES .wiz Word Document .wk1 Lotus Spreadsheet r2.1 .wk3 Lotus 123 Document .wk4 Lotus 123 Document .wks Lotus Spreadsheet r2.1 .wmf Windows MetaFile image .wp WordPerfect PC 5.1 Doc .wp4 WordPerfect PC 4.2 Doc .wp5 WordPerfect PC 5.1 Doc .wp6 WordPerfect PC 4.2 Doc .wpd WordPerfect Document .wpg Animated NeoChrome .wpm WordPerfect PC 4.2 Doc .wrl VRML File .ws Windows Script File (beta versions of WSH) .wsf Windows Script File used by WSH .wsh WSH control file .wve Amiga OctaMed music .x10 X-Windows Dump Table continued on following page F – File object (Object/JScript) 789 Extension Description .x11 X-Windows Dump .xbm X-Windows Bitmap .xlc Excel Worksheet .xlm Excel Worksheet .xls Excel Worksheet .xls Microsoft Excel Worksheet .xlt Excel Worksheet .xlw Excel Worksheet .xm 669 MOD Music .xml XML (Extensible Markup Language) Document .xpm X-Windows Pixmap .xsl XML style sheet Document .xwd X-Windows Dump .z Unix Compressed Files .zip ZIP Archives .zoo Zoo Archive Warnings: ❑ Beware of the .pac file extension. It is a proxy.pac auto-config file but it also represents an obscure image format supported by some plugins. See also: .jar, .java, .js, <SCRIPT ARCHIVE=" ">, <SCRIPT SRC=" ">, external.AddChannel(), Host environment, HTML file, Platform, proxy.pac File object (Object/JScript) A special JScript object representing a file on a locally mounted drive. Availability: JScript – 3.0 Internet Explorer – 4.0 IE myFile = File IE myFile = new File(aName) IE myFile = myFileSystem.GetFile(aName) IE myFile = myFileSystem.CreateTextFile(aName, aFlag) JavaScript syntax: IE myFile = myFileSystem.OpenTextFile(aName, aMode, aFlag, aFormat) aName The name of a file aFlag A flag indicating whether the file can be overwritten aMode An I/O mode for the file Argument list: aFormat A format code indicating ASCII or Unicode content JavaScript Programmer's Reference 790 Object properties: Attributes, constructor, dataFld, dataSrc, DateCreated, DateLastAccessed, DateLastModified, defaultValue, Drive, Name, ParentFolder, Path, prototype, recordNumber, ShortName, ShortPath, Size, Type, value Object methods: blur(), byteToString(), clearError(), click(), close(), Copy(), Delete(), eof(), error(), exists(), flush(), focus(), getLength(), getPosition(), Move(), open(), OpenAsTextStream(), read(), readByte(), readln(), select(), setPosition(), stringToByte(), write(), writeByte(), writeln() Event handlers: onBlur, onClick, onDblClick, onFocus This object is available in many contexts. On the server-side, it allows access to the server file system. In that context it is available as part of the Netscape Enterprise Server product (see the separate File object entries for the NES version). File objects may also exist client-side. Similar file system access may be possible there as well, although you should not expect this to work from within your browser. It may be available as part of a desktop scripting environment. Although they aren't instantiated as File objects, it is sometimes convenient to refer to a File object when we really mean to refer to an Input object whose type property is set to the "FILE" value. Warnings: ❑ Be aware that File objects are not standardized and may offer different methods, properties and functions in each context. Furthermore, the same named methods, properties and functions may not yield the same results across all implementations. ❑ The JScript File object and the identically named Netscape Enterprise Server File object do not share any properties or methods. They are completely different implementations. ❑ The JScript File object is somewhat odd in that its properties and methods are spelled with a capital letter at the start of their name. This is not typical JavaScript or JScript usage so you should beware of capitalization when scripting File objects with JScript. See also: FileSystem object, FileSystem.CreateTextFile(), FileSystem.GetFile(), FileSystem.OpenTextFile(), Folder object Property JavaScript JScript N IE Opera HTML Notes Attributes - 3.0 + - 4.0 + - - - dataFld - 3.0 + - 4.0 + - - Warning dataSrc - 3.0 + - 4.0 + - - Warning DateCreated - 3.0 + - 4.0 + - - - DateLastAccessed - 3.0 + - 4.0 + - - - DateLastModified - 3.0 + - 4.0 + - - - Table continued on following page F – File.Attributes (Property) 791 Property JavaScript JScript N IE Opera HTML Notes DefaultValue - 3.0 + - 4.0 + - - Warning Drive - 3.0 + - 4.0 + - - - Name - 3.0 + - 4.0 + - - - ParentFolder - 3.0 + - 4.0 + - - - Path - 3.0 + - 4.0 + - - - recordNumber - 3.0 + - 4.0 + - - Warning ShortName - 3.0 + - 4.0 + - - - ShortPath - 3.0 + - 4.0 + - - - Size - 3.0 + - 4.0 + - - - Type - 3.0 + - 4.0 + - - ReadOnly value - 3.0 + - 4.0 + - - Warning Method JavaScript JScript N IE Opera HTML Notes blur() - 3.0 + - 4.0 + - - Warning click() - 3.0 + - 4.0 + - - Warning Copy() - 3.0 + - 4.0 + - - - Delete() - 3.0 + - 4.0 + - - - focus() - 3.0 + - 4.0 + - - Warning Move() - 3.0 + - 4.0 + - - - OpenAsTextStream() - 3.0 + - 4.0 + - - - select() - 3.0 + - 4.0 + - - Warning Event name JavaScript JScript N IE Opera HTML Notes onBlur - 3.0 + - 4.0 + - - Warning onClick - 3.0 + - 4.0 + - 4.0 + Warning onDblClick - 3.0 + - 4.0 + - 4.0 + Warning onFocus - 3.0 + - 4.0 + - - Warning File.Attributes (Property) The file-system attributes of a file. Availability: JScript – 3.0 Internet Explorer – 4.0 Property/method value type: Number primitive JavaScript syntax: IE myFile.Attributes JavaScript Programmer's Reference 792 The File object is available for client-side use with the MSIE browser. This property contains its file system attributes. This property manages the attributes as a bit-mask with individual bits controlling different attributes. The bits can be accessed individually using the integer value corresponding to a power of 2. The table lists the integers that represent each different attribute: Value Attribute 0 No special attributes – normal file. 1 Read only access. 2 Hidden file. 4 Indicates a system file. 8 Refers to drive volume label and cannot be altered. 16 Refers to a folder and cannot be changed. 32 File has changed and needs to be backed up again. 64 File object represents a shortcut and not a real file. 128 File is compressed. You can use Bitwise OR expressions to merge them or accomplish the same with integer additions. You cannot alter the settings of bits 8, 16, 64 and 128 as these affect the structure of a file. That is to say, you cannot change a file into a folder or disk volume. You should read the current attributes setting and then modify it to write it back. The example illustrates some simple functions that encapsulate this conveniently. Where the bit needs to be set, a simple bitwise OR with a single bit value is accomplished in a single line. To clear a bit, we could use a bitwise AND having the corresponding bit clear. In these examples a different technique is used for illustration where the bit is set regardless of its previous state and is then cleared using a subtraction. That saves the computation of a complex bit-mask. An intermediate temporary variable is used to avoid signalling the operating system with unnecessarily modification requests. There are other alternative ways to accomplish this and you could write some generic functions to examine, set or clear a bit in a bit-mask and then call them from each of these wrappers indicating the bit you want to operate on. Example code: // Examine the read/write flag function isReadOnly(aFile) { return Boolean(aFile.Attributes & 1); } // Set the file read only function setReadOnly(aFile) { aFile.Attributes |= 1; } [...]... 4. 0 + - - - 3.0 + - 4. 0 + - - GetDrive() - 3.0 + - 4. 0 + - - GetDriveName() - 3.0 + - 4. 0 + - - GetExtensionName() - 3.0 + - 4. 0 + - - GetFile() - 3.0 + - 4. 0 + - - GetFileName() - 3.0 + - 4. 0 + - - GetFolder() - 3.0 + - 4. 0 + - - GetParentFolderName() - 3.0 + - 4. 0 + - - GetSpecialFolder() - 3.0 + - 4. 0 + - - GetTempName() - 3.0 + - 4. 0 + - - MoveFile() - 3.0 + - 4. 0 + - - MoveFolder() - 3.0 + - 4. 0... File object Method JavaScript JScript N IE Opera Notes BuildPath() - 3.0 + - 4. 0 + - - CopyFile() - 3.0 + - 4. 0 + - - CopyFolder() - 3.0 + - 4. 0 + - - CreateFolder() - 3.0 + - 4. 0 + - - CreateTextFile() - 3.0 + - 4. 0 + - - DeleteFile() - 3.0 + - 4. 0 + - - DeleteFolder() - 3.0 + - 4. 0 + - - DriveExists() - 3.0 + - 4. 0 + - - FileExists() - 3.0 + - 4. 0 + - - FolderExists() - 3.0 + - 4. 0 + - - GetAbsolutePath... object Enumerator object See also: Property JavaScript JScript N IE Opera Notes Count - 3.0 + - 4. 0 + - ReadOnly Method JavaScript JScript N IE Opera Notes Item() - 3.0 + - 4. 0 + - - Files.Count (Property) A count of the number of file items in the Files collection Availability: JScript – 3.0 Internet Explorer – 4. 0 Property/method value type: Number primitive JavaScript syntax: IE myFiles.Count The number... how You may corrupt your system although read-only access is unlikely to cause any harm 811 JavaScript Programmer's Reference javascript: URL, URL, view-source: URL See also: Files object (Object/JScript) A collection of files belonging together in a folder Availability: JScript – 3.0 Internet Explorer – 4. 0 JavaScript syntax: IE Object properties: Count Object methods: Item() myFiles = myFolder.Files... String primitive JavaScript syntax: IE myFile.DateLastModified The date that the file was last modified by being written to This is obtained by inspecting the file system and directory information for the file See also: Folder.DateLastModified 795 JavaScript Programmer's Reference File.Delete() (Method) A method that deletes files Availability: JScript – 3.0 Internet Explorer – 4. 0 JavaScript syntax:... File("/some/path/to/a/folder/filename.txt"); File.byteToString() (Method) Convert a byte value into a string Availability: JavaScript – 1.1 Netscape Enterprise Server– 2.0 Property/method value type: String object JavaScript syntax: NES myFile.byteToString(aNumber) Argument list: aNumber A byte value to be converted to a string 801 JavaScript Programmer's Reference This method provides a way of converting a single numeric value that represents... method, as they will be operating system specific See also: File.clearError() 803 JavaScript Programmer's Reference File.exists() (Method) A method that returns a flag to indicate whether the file exists or not Availability: JavaScript – 1.1 Netscape Enterprise Server – 2.0 Property/method value type: Boolean primitive JavaScript syntax: NES myFile.exists() This method returns the Boolean true value... File.writeByte() File.readln() (Method) Reads from the current position up to the next newline character in the file Availability: JavaScript – 1.1 Netscape Enterprise Server version – 2.0 Property/method value type: String primitive JavaScript syntax: NES myFile.readln() 807 JavaScript Programmer's Reference After this method returns the string read from the file, the position pointer is then located at the beginning... can use this to write fixed length data to a file See also: File.flush(), File.read(), File.writeByte(), File.writeln() 809 JavaScript Programmer's Reference File.writeByte() (Method) Writes a single byte to the file Availability: JavaScript – 1.1 Netscape Enterprise Server– 2.0 JavaScript syntax: NES myFile.writeByte(aNumber) Argument list: aNumber The value of a byte to be written to the file This... Examine the system flag function isSystemFile(aFile) { return Boolean(aFile.Attributes & 4) ; } // Set file to be a system file function setSystem(aFile) { aFile.Attributes |= 4; } // Set file to be a non system file function setPublic(aFile) { var myAttributes = aFile.Attributes |= 4; aFile.Attributes = myAttributes – 4; } // -// Examine the drive volume flag function isDriveVolume(aFile) . Notes DefaultValue - 3.0 + - 4. 0 + - - Warning Drive - 3.0 + - 4. 0 + - - - Name - 3.0 + - 4. 0 + - - - ParentFolder - 3.0 + - 4. 0 + - - - Path - 3.0 + - 4. 0 + - - - recordNumber - 3.0 + - 4. 0 + - - Warning ShortName . Warning ShortName - 3.0 + - 4. 0 + - - - ShortPath - 3.0 + - 4. 0 + - - - Size - 3.0 + - 4. 0 + - - - Type - 3.0 + - 4. 0 + - - ReadOnly value - 3.0 + - 4. 0 + - - Warning Method JavaScript JScript N. - 3.0 + - 4. 0 + - - Warning click() - 3.0 + - 4. 0 + - - Warning Copy() - 3.0 + - 4. 0 + - - - Delete() - 3.0 + - 4. 0 + - - - focus() - 3.0 + - 4. 0 + - - Warning Move() - 3.0 + - 4. 0 + - -

Ngày đăng: 12/08/2014, 19:21

Mục lục

  • F

    • File object (Object/JScript)

    • File.Attributes (Property)

    • File.Copy() (Method)

    • File.DateCreated (Property)

    • File.DateLastAccessed (Property)

    • File.DateLastModified (Property)

    • File.Delete() (Method)

    • File.Drive (Property)

    • File.Move() (Method)

    • File.Name (Property)

    • File.OpenAsTextStream() (Method)

    • File.ParentFolder (Property)

    • File.Path (Property)

    • File.ShortName (Property)

    • File.ShortPath (Property)

    • File.Size (Property)

    • File.Type (Property)

    • File object (Object/NES)

    • (Constructor)

    • File.byteToString() (Method)

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan