Ajax paging is used in the client analysis of data, and then sent to the PHP file for processing, back to the client management, the idea is this.
Here used three files js file and a php file: cookie.js page.js proptype.js result.php file, we Yi Yilai look at the contents of each file.
First look at the Cookie.js code:
JavaScript Document
function Setcookie (name,value,x_expires,x_path,x_domain,x_secure) {//Set a cookie-valued functions
Alert (name)
var argv = setcookie.arguments;
alert (THIS.ARGV);
var argc = SetCookie.arguments.length;
var expires = (argc > 2)? X_expires:null;
var path = (argc > 3)? X_path:null;
var domain = (argc > 4)? X_domain:null;
var secure = (argc > 5)? X_secure:false;
Document.cookie = name + "=" + Escape (value) +
((expires = null)? "" : ("; Expires= "+ expires.togmtstring ()) +
((Path = null)? "" : ("; Path= "+ path)" +
(domain = null)? "" : ("; domain= "+ domain)" +
(Secure = = True)? "; Secure ":" ");
}
function GetCookie (name) {//Read the cookie value functions for the specified name
Alert (Document.cookie)
var arg = name + "=";
var alen = Arg.length;
var clen = document.cookie.length;
var i = 0;
while (I < Clen)
{
var j = i + Alen;
if (Document.cookie.substring (i, j) = arg)
Return Getcookieval (j);
i = Document.cookie.indexOf (";", I);
if (i = = 1) break;
i+=2;
}
return null;
}
function Getcookieval (offset) {
var endstr = document.cookie.indexOf (";", offset);
if (endstr = = 1)
Endstr = Document.cookie.length;
Return unescape (document.cookie.substring (offset, endstr));
}
function Deletecookie (name) {//delete cookie value functions
var exp = new Date ();
Exp.settime (Exp.gettime ()-1);
var cval = GetCookie (name);
Document.cookie = name + "=" + Cval + "; Expires= "+ exp.togmtstring ();
}
The owner of this file is to process cookies