JavaScript operation file description

xiaoxiao2021-04-03  215

Transfer from: http://renyu732.cnblogs.com/archive/2005/11/08/271882.aspx JavaScript is a scripting language that is not open to web pages, relying on it, the content of a web page is lively, rich. But maybe you haven't found and apply some more and more features? For example, read, write, and delete files and folders, just like often work in high-level languages ​​such as VB, VC. How, do you need to understand this knowledge? Then please come with me, this article will describe how to use the JavaScript language to perform file operations.

First, functional implementation core: FileSystemObject object

In fact, to implement file operation functions in JavaScript, mainly on the FileSystemObject object. Let's take a look at the objects and collections of this object, in a detailed introduction to the various properties and methods of the FILESystemObject object.

Second, FILESYSTEMOBJECT programming three songs

Programming using the FileSystemObject object is simple, usually the following steps: Create a FileSystemObject object, apply related methods, access object-related properties.

(1) Creating a FileSystemObject object

Creating a FileSystemObject object as long as 1 line:

VAR fso = new activxObject ("scripting.filesystemObject");

After the above code is executed, the FSO is an instance of a FILESystemObject object.

(2) Application related methods

Once you have created an object instance, you can use the object's related ways. For example, create a text file using the CreateTextFile method:

VAR fso = new activxObject ("scripting.filesystemObject");

Var f1 = fso.createtextfile ("c: //myjstest.txt", true ");

(3) Access object related properties

To access the object's related properties, first create a handle of the object, this is to implement the GET series method: getDrive is responsible for obtaining the drive information, getFolder is responsible for obtaining folder information, getFile is responsible for obtaining file information. For example, after the code below, F1 becomes a handle of the file c: /test.txt:

VAR fso = new activxObject ("scripting.filesystemObject");

Var f1 = fso.getfile ("c: //myjstest.txt");

Then, use the F1 access to the relevant properties of the object. such as:

VAR fso = new activxObject ("scripting.filesystemObject");

Var f1 = fso.getfile ("c: //myjstest.txt");

Alert ("File Last Modified:" F1.DateLastModified;

After performing the last sentence above, the final modification date attribute value of C: /MYJSTEST.TXT will be displayed.

But one thing note: For objects established using the CREATE method, you don't have to use the GET method to get the object handle, then you can use the crete method to create the handle name:

VAR fso = new activxObject ("scripting.filesystemObject"); var f1 = fso.createtextFile ("c: //myjstest.txt", true ");

Alert ("File Last Modified:" F1.DateLastModified;

Third, operating drive (drives)

Using the FileSystemObject object to program an operation drive (airs) and folders (Folders), it is easy to interact with files in the Windows file browser, such as copy, moving folders, and get the properties of the folder.

(1) DRIVES object attribute

The Drive object is responsible for collecting physical or logical drive resources in the system, which has the following properties:

l Totalsize: The drive size calculated in byte (byte).

l AvailableSpace or FreeSpace: The drive is available in byte (Byte).

l Driveletter: Drive letters.

l DriveType: The drive type, the value is: Removable (mobile media), Fixed (fixed media), NetWork, CD-ROM, or RAM disk.

l SerialNumber: The series code of the drive.

l FileSystem: The file system type of the drive is in FAT, FAT32, and NTFS.

l isReady: Whether the drive is available.

l ShareName: Shared name.

l Volumename: Volume Boot Name.

l Path and rootfolder: The path or root directory name of the drive.

(2) DRIVE object operation routine

The following routines displays information about the volume label, total capacity, and available space of the drive C:

VAR FSO, DRV, S = ""

Fso = New ActiveXObject ("scripting.filesystemObject");

DRV = fso.getdrive (fso.getdrivename);

S = "Drive C:" "-";

s = drv.volumename "/ n";

S = "Total Space:" DRV.TOTALSIZE / 1024;

S = "KB" "/ n";

S = "Free Space:" DRV.FREESPACE / 1024;

S = "KB" "/ n";

Alert (s);

The following message box appears after execution:

Fourth, operation folder (Folders)

The operations involving folders include creation, movement, delete, and obtain related properties.

(1) List of related properties and methods of Folder objects

(2) Folder object operation routine

The following routines will practice to obtain the parent folder name, create a folder, delete folder, and determine whether it is root directory: VAR FSO, FLDR, S = ""

// Create a FileSystemObject object instance

Fso = New ActiveXObject ("scripting.filesystemObject");

/ / Get a Drive object

FLDR = fso.getfolder ("c: //");

/ / Display the parent directory name

Alert ("Parent Folder Name IS: FLDR " / N ");

// Display the DRIVE name

Alert ("Contained on Drive" Fldr.drive "/ N");

/ / Judgment is the root directory

Fldr.isrootfolder

"" this is the root folder. ");

Else

Alert ("This Folder isn't a root folder.");

Alert ("/ n / n");

// Create a new folder

Fso.createfolder ("c: // bogus");

Alert ("CREATED Folder C: // Bogus" "/ N");

// Display the folder base name, does not include the path name

Alert ("BaseName =" fso.getBaseName ("c: // bogus") "/ n");

/ / Delete the created folder

Fso.Deletefolder ("C: // Bogus");

Alert ("Deleded Folder C: // Bogus" "/ N");

V. Operation file (files)

The operation of the file is complicated than the drive (DRIVE) and folder (Folder) described above, basically divided into two categories: creation, copy, mobile, delete operation, and creation of file content , Add, delete, and read operations. The following details are described in detail below.

(1) Creating a file

There are three ways to create an empty text file, which is sometimes called text stream.

The first is to use the CreateTextFile method. code show as below:

VAR FSO, F1;

Fso = New ActiveXObject ("scripting.filesystemObject");

F1 = fso.createtextfile ("c: //testfile.txt", true);

The second is to use the OpenTextFile method and add the ForWriting property, the value of ForWriting is 2. code show as below:

VAR FSO, TS;

Var forwriting = 2;

Fso = New ActiveXObject ("scripting.filesystemObject");

Ts = fso.opentextfile ("c: //test.txt", forwriting, true);

The third is to use the OpenASTextStream method, you can also set the Forwriting property. code show as below:

VAR FSO, F1, TS;

Var forwriting = 2; fso = new activiXObject ("scripting.filesystemObject");

Fso.createtextfile ("c: //test1.txt");

F1 = fso.getfile ("c: //test1.txt");

Ts = f1.openastextStream (ForWriting, True);

(2) Add data to a file

When the file is created, you should generally follow the "Open File-> Fill Data -> Off File" step to achieve the purpose of adding data to the file.

Open the file Use the OpenTextFile method of the FileSystemObject object, or the OpenASTextStream method for the File object.

Fill in the data to use the Write, WriteLine or Writeblanklines method for the TextStream object. Under the function of implementing write data, the three differences are that the Write method does not add new wraps at the end of the data, and the WriteLine method is to add a new wrap, while WriteBlanklines adds one or more empty. Row.

Closing the file You can use the Close method of the TextStream object.

(3) Creating files and adding data routines

The following code will create a file, add data, and turn off files to combine several steps:

VAR FSO, TF;

Fso = New ActiveXObject ("scripting.filesystemObject");

// Create a new file

Tf = fso.createtextfile ("c: //testfile.txt", true);

// Fill in the data and increase the newline

Tf.writeline ("Testing 1, 2, 3.");

// Add 3 empty rows

Tf.writeblanklines (3);

// Fill in a row, do not have a newline

Tf.write ("this is a test.");

// Turn the file

Tf.close ();

(4) Read the contents of the file

Read data from a text file To use the Read, Readline or Readall method of the TextStream object. The READ method is used to read the specified number of characters in the file; the Readline method reads a single line, but does not include a newline method; the Readall method reads the entire content of the text file. The read content is stored in a string variable for display, analysis. When reading the file content using the Read or Readline method, if you want to skip some parts, you should use the SKIP or Skipline method.

The following code presentation opens the file, fill in the data, and then read the data:

VAR FSO, F1, TS, S;

Var forreading = 1;

Fso = New ActiveXObject ("scripting.filesystemObject");

// Create a file

F1 = fso.createtextfile ("c: //testfile.txt", true);

// Fill in a line of data

F1.writeline ("Hello World");

f1.writeblanklines (1);

// Turn the file

f1.close ();

// open a file

Ts = fso.opentextfile ("c: //testfile.txt", forreading);

// read the file a line of content to the string

S = ts.readline ();

// Display string information

Alert ("File Contents = '" S "");

// Turn the file

Ts.close ();

(5) Moving, copying and deleting files

For the above three file operations, JavaScript has two corresponding methods: file.move or filesystemObject.movefile is used for mobile files; file.copy or filesystemObject.copy is used for copy files; file.delete or filesystemObject.deletefile is used to delete file.

The following code demonstrates a text file in the root of the drive C, fill in some content, then move the file to the / TMP directory, then create a file copy below the directory / TEMP, finally delete the files of these two directories:

VAR FSO, F1, F2, S;

Fso = New ActiveXObject ("scripting.filesystemObject");

F1 = fso.createtextfile ("c: //testfile.txt", true);

// Write a line

F1.write ("this is a test.");

// Turn the file

f1.close ();

/ / Get the file handle under the C: / root directory

F2 = fso.getfile ("c: //testfile.txt");

// Mobile file to / TMP directory

F2.move ("c: //tmp/testfile.txt");

// Copy file to / temp directory

F2.copy ("c: //temp/testfile.txt");

/ / Get the file handle

F2 = fso.getfile ("c: //tmp/testfile.txt");

F3 = fso.getfile ("c: //temp/testfile.txt");

// Delete Files

f2.delete ();

f3.delete ();

Sixth, junction

Through the introduction and examples of various objects, properties, and methods of FileSystemObject, I believe that you have clearly understood how to operate drives, files, and folders in the page using JavaScript language. However, the routines mentioned above are very simple, to be comprehensive, flexible to master JavaScript file operation technology, and require a lot of practical practice. And some remind everyone that because of the advanced operation of reading such a file in the browser, for the default browser security level, there will be a message prompt before the code is running, please in the actual environment Tip visitor pay attention.

First, functional implementation core: FileSystemObject object

To implement file operation functions in JavaScript, it is mainly based on the FileSystemObject object.

Second, FileSystemObject Programming

Programming using the FileSystemObject object is simple, usually the following steps: Create a FileSystemObject object, apply related methods, access object-related properties.

(1) Creating a FileSystemObject object

Creating a FileSystemObject object as long as 1 line:

VAR fso = new activxObject ("scripting.filesystemObject");

After the above code is executed, the FSO is an instance of a FILESystemObject object.

(2) Application related methods

Once you have created an object instance, you can use the object's related ways. For example, create a text file using the CreateTextFile method: var fso = new activiXObject ("scripting.filesystemObject);

Var f1 = fso.createtextfile ("c: //myjstest.txt", true ");

(3) Access object related properties

To access the object's related properties, first create a handle of the object, this is to implement the GET series method: getDrive is responsible for obtaining the drive information, getFolder is responsible for obtaining folder information, getFile is responsible for obtaining file information. For example, after the code below, F1 becomes a handle of the file c: /test.txt:

VAR fso = new activxObject ("scripting.filesystemObject");

Var f1 = fso.getfile ("c: //myjstest.txt");

Then, use the F1 access to the relevant properties of the object. such as:

VAR fso = new activxObject ("scripting.filesystemObject");

Var f1 = fso.getfile ("c: //myjstest.txt");

Alert ("File Last Modified:" F1.DateLastModified;

After performing the last sentence above, the final modification date attribute value of C: /MYJSTEST.TXT will be displayed.

But one thing note: For objects established using the CREATE method, you don't have to use the GET method to get the object handle, then you can use the crete method to create the handle name:

VAR fso = new activxObject ("scripting.filesystemObject");

Var f1 = fso.createtextfile ("c: //myjstest.txt", true ");

Alert ("File Last Modified:" F1.DateLastModified;

Third, operating drive (drives)

Using the FileSystemObject object to program an operation drive (airs) and folders (Folders), it is easy to interact with files in the Windows file browser, such as copy, moving folders, and get the properties of the folder.

(1) DRIVES object attribute

The Drive object is responsible for collecting physical or logical drive resources in the system, which has the following properties:

l Totalsize: The drive size calculated in byte (byte).

l AvailableSpace or FreeSpace: The drive is available in byte (Byte).

l Driveletter: Drive letters.

l DriveType: The drive type, the value is: Removable (mobile media), Fixed (fixed media), NetWork, CD-ROM, or RAM disk.

l SerialNumber: The series code of the drive.

l FileSystem: The file system type of the drive is in FAT, FAT32, and NTFS. l isReady: Whether the drive is available.

l ShareName: Shared name.

l Volumename: Volume Boot Name.

l Path and rootfolder: The path or root directory name of the drive.

(2) DRIVE object operation routine

The following routines displays information about the volume label, total capacity, and available space of the drive C:

VAR FSO, DRV, S = ""

Fso = New ActiveXObject ("scripting.filesystemObject");

DRV = fso.getdrive (fso.getdrivename);

S = "Drive C:" "-";

s = drv.volumename "/ n";

S = "Total Space:" DRV.TOTALSIZE / 1024;

S = "KB" "/ n";

S = "Free Space:" DRV.FREESPACE / 1024;

S = "KB" "/ n";

Alert (s);

Fourth, operation folder (Folders)

The operations involving folders include creation, movement, delete, and obtain related properties.

Folder object operation routine:

The following routines will practice to obtain the parent folder name, create a folder, delete folder, and determine whether it is root directory:

VAR FSO, FLDR, S = ""

// Create a FileSystemObject object instance

Fso = New ActiveXObject ("scripting.filesystemObject");

/ / Get a Drive object

FLDR = fso.getfolder ("c: //");

/ / Display the parent directory name

Alert ("Parent Folder Name IS: FLDR " / N ");

// Display the DRIVE name

Alert ("Contained on Drive" Fldr.drive "/ N");

/ / Judgment is the root directory

Fldr.isrootfolder

"" this is the root folder. ");

Else

Alert ("This Folder isn't a root folder.");

Alert ("/ n / n");

// Create a new folder

Fso.createfolder ("c: // bogus");

Alert ("CREATED Folder C: // Bogus" "/ N");

// Display the folder base name, does not include the path name

Alert ("BaseName =" fso.getBaseName ("c: // bogus") "/ n");

/ / Delete the created folder

Fso.Deletefolder ("C: // Bogus");

Alert ("Deleded Folder C: // Bogus" "/ N"); 5, Operation File (Files)

The operation of the file is complicated than the drive (DRIVE) and folder (Folder) described above, basically divided into two categories: creation, copy, mobile, delete operation, and creation of file content , Add, delete, and read operations. The following details are described in detail below.

(1) Creating a file

There are three ways to create an empty text file, which is sometimes called text stream.

The first is to use the CreateTextFile method. code show as below:

VAR FSO, F1;

Fso = New ActiveXObject ("scripting.filesystemObject");

F1 = fso.createtextfile ("c: //testfile.txt", true);

The second is to use the OpenTextFile method and add the ForWriting property, the value of ForWriting is 2. code show as below:

VAR FSO, TS;

Var forwriting = 2;

Fso = New ActiveXObject ("scripting.filesystemObject");

Ts = fso.opentextfile ("c: //test.txt", forwriting, true);

The third is to use the OpenASTextStream method, you can also set the Forwriting property. code show as below:

VAR FSO, F1, TS;

Var forwriting = 2;

Fso = New ActiveXObject ("scripting.filesystemObject");

Fso.createtextfile ("c: //test1.txt");

F1 = fso.getfile ("c: //test1.txt");

Ts = f1.openastextStream (ForWriting, True);

(2) Add data to a file

When the file is created, you should generally follow the "Open File-> Fill Data -> Off File" step to achieve the purpose of adding data to the file.

Open the file Use the OpenTextFile method of the FileSystemObject object, or the OpenASTextStream method for the File object.

Fill in the data to use the Write, WriteLine or Writeblanklines method for the TextStream object. Under the function of implementing write data, the three differences are that the Write method does not add new wraps at the end of the data, and the WriteLine method is to add a new wrap, while WriteBlanklines adds one or more empty. Row.

Closing the file You can use the Close method of the TextStream object.

(3) Creating files and adding data routines

The following code will create a file, add data, and turn off files to combine several steps:

VAR FSO, TF;

Fso = New ActiveXObject ("scripting.filesystemObject");

// Create a new file

Tf = fso.createtextfile ("c: //testfile.txt", true);

// Fill in the data and increase the newline

Tf.WriteLine ("Testing 1, 2, 3."); // Add 3 empty rows

Tf.writeblanklines (3);

// Fill in a row, do not have a newline

Tf.write ("this is a test.");

// Turn the file

Tf.close ();

(4) Read the contents of the file

Read data from a text file To use the Read, Readline or Readall method of the TextStream object. The READ method is used to read the specified number of characters in the file; the Readline method reads a single line, but does not include a newline method; the Readall method reads the entire content of the text file. The read content is stored in a string variable for display, analysis.

How to use XML Data Source Objects XML Data Source Objects in Web Design is an ActiveX control, allowing you to operate data between XML files and HTML pages. This article will show you how to extract data from a variety of XML data sources, and how to display this data using JavaScript. XML Data Source Object DSO is a Microsoft ActiveX control, which is built on the version after Microsoft IE4. This object allows you to extract an external XML file or in an HTML file to an HTML page. You can use XML-DSO to select content from an external XML file in a web page, extract XML data from the XML embedded in the web page, and then use JavaScript to operate this data. However, it is not recommended to use this object in the Internet, because DSO can only work in a browser over MSIE 4, so this may bring some compatibility issues. Therefore, it is very suitable in entering the enterprise internal network. Started to initialize the XML - DSO object, we use the tag. ClassID for XML-DSO is: CLSID: 550DDA30-0541-11D2-9CA9-0060B0EC3D39 This ID uniquely identifies XML-DSO. Use the following code to initialize this control in a web page: premshree pillai Male vinod Male < / dB>
Note This code does not initialize an XML-DSO object. This is because one is implicitly created in the use of XML data island. The output should be: premshree pillai Male Note Two and tags in XML data island. Using this method, you can only extract the first instance in these tags. The code in the code list 2 extracts all instances using the tag: The output will be: Name SexPremShree Pillai Malevinod Male In Code List 2, the
tag extracts data using the
tag within the
tag. The table will automatically repeat each instance of ( and ). Code List 2:

XML DSO-EXAMPLE2.HTM </ Title> </ head> <body bgcolor = "# ffffff"> <xml id = "xmldb"> <DB> <Member> <name> premshree pillai <name> <sex> Male </ sex> </ member> <member> <name> vinod </ name> <sex> Male </ sex> </ member> < / dB> </ xml> <table datarc = "# xmldb" border = "1"> <THEAD> <TH> Name </ th> <TH> Sex </ th> </ thead> <tr> <td> <Div datafld = "name"> </ div> </ td> <td> <div DataFld = "SEX"> </ div> </ td> </ tr> </ table> </ body> </ html > Using external XML file extract data To load an external XML file using XML-DSO, you must explicitly include this object and use some JavaScript. First create an XML-DSO object, use ID MyXML. Add a width and height attribute to the <Object> tag, and then set their value of 0. This ensures that the XML-DSO object will not occupy any space of your web page. Second, use DataSRC to create a table like MYXML - similar to code list 2. The code extracts data using the <div> tag (in TD tag), using DataFLD as information on the first column, and uses the URL as the second column. Add <script> tag, because here, the external XML explicitly declares the XML file you want to load using the Java script. Set the variable XMLDSO for MyXML.XMLDocument. MyXML references you have created objects. Next, use XML-DSO's LOAD () method to load EXAMPLE3.XML. File EXAMPLE3.XML is connected to the object myXML.</p> <p><! - eXample3.xml -> <? XML Version = "1.0"?> <Ticker> <item> <message> javascript ticker using xml dso </ message> <url> http://someurl.com </ URL> </ item> </ ticker> Now study the following HTML page: <! - example3.htm -> <html> <head> <title> XML DSO-EXAMPLE3.HTM </ Title> <script Language = "javascript"> Function load () {var xmldso = myxml.xmldocument; xmldso.load ("eXample3.xml");} </ script> </ head> <body bgcolor = "# ffffff" online = "load ()> <Object id = "MYXML" classid = "CLSID: 550DDA30-0541-11D2-9CA9-0060B0EC3D39" width = "0" height = "0"> </ object> <table datasrc = "# myXML" border = "1"> <THEAD> <TH> Message </ th> <TH> URL </ th> </ thead> <tr> <TD> <div datafld = "message"> </ div> </ td> <TD> <div DataFld = "URL"> </ div> </ td> </ tr> </ table> </ body> </ html> output should be: Message Url JavaScript Ticker Using XML DSO HTTP: // The script on Someurl.com is very special. Here is a more general script:</p> <p><Script language = "JavaScript"> var xmlDso; function load (xmlFile, objName) {eval ( 'xmlDso =' objName 'XMLDocument.'); XmlDso.load (xmlFile);} </ script> Now, to load any XML File Use: Load ("SomexmlFile.xml", "AnyxmldsoObject"); Using XML-DSO and JavaScript assumes that you have an XML file that contains names, email addresses, and phone numbers. You want to use it to build an application, showing everyone's file - display one at a time. Users will use the "Next" and "Previous" buttons to browse the data of each person. JavaScript can help you achieve this. The following code uses a recordset method to save all the data in the file to a variable memory in a MEMBERSET. The MOVENEXT () method points to the next data item (next line). The script is then loaded into the XML file eXample4.xml and saves the record to the variable memberset. The first record will be displayed, but MemberSet.MoveNext () points to the next record relative to the previous specified data in the file. <! - eXample4.xml -> <? Xml version = "1.0"?> <Mydb> <member> <name> premshree pillai </ name> <sex> Male </ sex> </ member> <member> <Name> vinod </ name> <sex> Male </ sex> </ member> <member> <name> Santhosh </ name> <sex> Male </ sex> </ member> </ mydb> here is the corresponding HTML file:</p> <p><! - example4.htm -> <html> <head> <title> XML DSO-EXAMPLE4.HTM </ Title> <script language = "javascript"> function load () {var xmldso = mydb.xmldocument; xmldso .load ("eXample4.xml"); / * get the completion record set * / var memberset = mydb.recordset; / * Go to next data * / memberset.movenext ();} </ script> </ head> < Body bgcolor = "# ffffff" OnLoad = "LOAD ()> <object id =" MYDB "classid =" CLSID: 550DDA30-0541-11D2-9CA9-0060B0EC3D39 "width =" 0 "height =" 0 "> </ Object> <span datasrc = "# mydb" datafld = "name"> </ span> </ body> </ html> output should be: VinOD give more methods of using JavaScript operation XML-DSO: · MovePrevious : Refers to a forward data item. · MoveFirst (): Point to the first data item. · MoveLast (): Point to the last data item. · EOF: This property is used to detect if we have reached the bottom of the data record. Using XML-DSO and JavaScript assumes that you have an XML file that contains names, email addresses, and phone numbers. You want to use it to build an application, showing everyone's file - display one at a time. Users will use the "Next" and "Previous" buttons to browse the data of each person. JavaScript can help you achieve this. The following code uses a recordset method to save all the data in the file to a variable memory in a MEMBERSET. The MOVENEXT () method points to the next data item (next line). The script is then loaded into the XML file eXample4.xml and saves the record to the variable memberset. The first record will be displayed, but MemberSet.MoveNext () points to the next record relative to the previous specified data in the file.</p> <p><! - eXample4.xml -> <? Xml version = "1.0"?> <Mydb> <member> <name> premshree pillai </ name> <sex> Male </ sex> </ member> <member> <Name> vinod </ name> <sex> Male </ sex> </ member> <member> <name> Santhosh </ name> <sex> Male </ sex> </ member> </ mydb> here is the corresponding HTML file:</p> <p><! - example4.htm -> <html> <head> <title> XML DSO-EXAMPLE4.HTM </ Title> <script language = "javascript"> function load () {var xmldso = mydb.xmldocument; xmldso .load ("eXample4.xml"); / * get the completion record set * / var memberset = mydb.recordset; / * Go to next data * / memberset.movenext ();} </ script> </ head> < Body bgcolor = "# ffffff" OnLoad = "LOAD ()> <object id =" MYDB "classid =" CLSID: 550DDA30-0541-11D2-9CA9-0060B0EC3D39 "width =" 0 "height =" 0 "> </ Object> <span datasrc = "# mydb" datafld = "name"> </ span> </ body> </ html> output should be: VinOD give more methods of using JavaScript operation XML-DSO: · MovePrevious : Refers to a forward data item. · MoveFirst (): Point to the first data item. · MoveLast (): Point to the last data item. · EOF: This property is used to detect if we have reached the bottom of the data record. INITTICKER () first checks if there is IE 4 . If the browser is IE4 , this XML file is passed and loaded as a parameter. If the timer fails, the XMLDsoticker () function is called. XMLDsoticker () has the same parameters in addition to the XMLFile parameters, because the XML file has been loaded. XmlDsoticker () Check if the Variable Counter is smaller than MaxMSGS-1. If yes, the MoveNext () method points to the next data item in the TickerSet. The Body of the HTML page contains the following code:</p></div><div class="text-center mt-3 text-grey"> 转载请注明原文地址:https://www.9cbs.com/read-131609.html</div><div class="plugin d-flex justify-content-center mt-3"></div><hr><div class="row"><div class="col-lg-12 text-muted mt-2"><i class="icon-tags mr-2"></i><span class="badge border border-secondary mr-2"><h2 class="h6 mb-0 small"><a class="text-secondary" href="tag-2.html">9cbs</a></h2></span></div></div></div></div><div class="card card-postlist border-white shadow"><div class="card-body"><div class="card-title"><div class="d-flex justify-content-between"><div><b>New Post</b>(<span class="posts">0</span>) </div><div></div></div></div><ul class="postlist list-unstyled"> </ul></div></div><div class="d-none threadlist"><input type="checkbox" name="modtid" value="131609" checked /></div></div></div></div></div><footer class="text-muted small bg-dark py-4 mt-3" id="footer"><div class="container"><div class="row"><div class="col">CopyRight © 2020 All Rights Reserved </div><div class="col text-right">Processed: <b>0.048</b>, SQL: <b>9</b></div></div></div></footer><script src="./lang/en-us/lang.js?2.2.0"></script><script src="view/js/jquery.min.js?2.2.0"></script><script src="view/js/popper.min.js?2.2.0"></script><script src="view/js/bootstrap.min.js?2.2.0"></script><script src="view/js/xiuno.js?2.2.0"></script><script src="view/js/bootstrap-plugin.js?2.2.0"></script><script src="view/js/async.min.js?2.2.0"></script><script src="view/js/form.js?2.2.0"></script><script> var debug = DEBUG = 0; var url_rewrite_on = 1; var url_path = './'; var forumarr = {"1":"Tech"}; var fid = 1; var uid = 0; var gid = 0; xn.options.water_image_url = 'view/img/water-small.png'; </script><script src="view/js/wellcms.js?2.2.0"></script><a class="scroll-to-top rounded" href="javascript:void(0);"><i class="icon-angle-up"></i></a><a class="scroll-to-bottom rounded" href="javascript:void(0);" style="display: inline;"><i class="icon-angle-down"></i></a></body></html><script> var forum_url = 'list-1.html'; var safe_token = '0oK8H2EzQ_2B952DSL484oOpyFVSvhno6KW9RmI86qVouQl8jPvFOKCetQfe9GyhkH8YqM4fHzfHBDtqpSqWK9YQ_3D_3D'; var body = $('body'); body.on('submit', '#form', function() { var jthis = $(this); var jsubmit = jthis.find('#submit'); jthis.reset(); jsubmit.button('loading'); var postdata = jthis.serializeObject(); $.xpost(jthis.attr('action'), postdata, function(code, message) { if(code == 0) { location.reload(); } else { $.alert(message); jsubmit.button('reset'); } }); return false; }); function resize_image() { var jmessagelist = $('div.message'); var first_width = jmessagelist.width(); jmessagelist.each(function() { var jdiv = $(this); var maxwidth = jdiv.attr('isfirst') ? first_width : jdiv.width(); var jmessage_width = Math.min(jdiv.width(), maxwidth); jdiv.find('img, embed, iframe, video').each(function() { var jimg = $(this); var img_width = this.org_width; var img_height = this.org_height; if(!img_width) { var img_width = jimg.attr('width'); var img_height = jimg.attr('height'); this.org_width = img_width; this.org_height = img_height; } if(img_width > jmessage_width) { if(this.tagName == 'IMG') { jimg.width(jmessage_width); jimg.css('height', 'auto'); jimg.css('cursor', 'pointer'); jimg.on('click', function() { }); } else { jimg.width(jmessage_width); var height = (img_height / img_width) * jimg.width(); jimg.height(height); } } }); }); } function resize_table() { $('div.message').each(function() { var jdiv = $(this); jdiv.find('table').addClass('table').wrap('<div class="table-responsive"></div>'); }); } $(function() { resize_image(); resize_table(); $(window).on('resize', resize_image); }); var jmessage = $('#message'); jmessage.on('focus', function() {if(jmessage.t) { clearTimeout(jmessage.t); jmessage.t = null; } jmessage.css('height', '6rem'); }); jmessage.on('blur', function() {jmessage.t = setTimeout(function() { jmessage.css('height', '2.5rem');}, 1000); }); $('#nav li[data-active="fid-1"]').addClass('active'); </script>