AjaxÎÞË¢·ÖÒ³
jsÎļþ:
var where=" where pd_Isjifen=0 and pd_Isok=1"; //²éѯÌõ¼þ
var psize=16; //²éѯÊý¾ÝÊýÄ¿
var pindex=0;//µ±Ç°Ò³Êý
var order=" order by pd_Update desc,type_sort,pd_brand,pd_typeid"; //ÅÅÐòÌõ¼þ
var temp=0; //Ä£°åÃû³Æ
var Pcount=0;
//»ñÈ¡²ÎÊý
function getUrlPara(paraName)
{
var str=window.location.search;
if (str.indexOf(paraName)!=-1)
{
var pos_start=str.indexOf(paraName)+paraName.length+1;
var pos_end=str.indexOf("&",pos_start);
if (pos_end==-1)
{
return str.substring(pos_start);
}
else
{
return str.substring(pos_start,pos_end)
}
}
else
{
return "";
}
}
//ÉèÖòéѯÌõ¼þ
function Set_Where()
{
var country=getUrlPara("country");
if(country!='')
{
where+=" and pd_country='" + unescape(country) + "'";
}
var search=getUrlPara("search");
if(search!='')
{
where+=" and " + Get_where(unescape(search));
}
var cell=getUrlPara("cell");
if(cell!='')
{
where+=" and pd_Is" + cell + "=1";
}
var days=getUrlPara("days");
if(days!='')
{
where+=" and DATEDIFF([day], pd_update, GETDATE()) <= " + days;
}
var tp=getUrlPara("tp");
if(tp!='')
{
where+=" and pd_Isimport='" + (parseInt(tp)-1)+"'";
order=" order by pd_Update desc,type_sort desc,pd_brand,pd_typeid";
}
var brand=getUrlPara("brend");
if(brand!='')
{
where+=" and pd_brand='" + unescape(brand) + "'";
}
}
function Get_where(str)
{
return " (charindex(RTRIM('" + str + "'),RTRIM(pd_keyword))>0 or charindex(RTRIM('" + str + "'),RTRIM(pd_name))>0 or charindex(RTRIM('" + str + "'),RTRIM(pd_search))>0 or pd_brand='" + str + "' or pd_itemno='" + str + "')";
}
//»ñÈ¡Êý¾Ý
function Get_div()
{
var div="²éѯÊý¾Ý³¬Ê±£¬ÇëË¢ÐÂÒ³ÃæÖØвéѯ!";
where=where.replace(/\
Ïà¹ØÎĵµ£º
ÎÒÓÃActiveXObject("Microsoft.xmldom")À´×°ÔØxmlÎĵµÊ±£¬¾¹È»ÀÏÊÇÌáʾװÔØʧ°Ü£¬ºóÀ´ÉÏÍøËÑË÷ÁËÏ£¬ËµÊDz»ÄÜÖ±½Ó°üº¬Õâ5¸ö·ûºÅ£¨'><&"£©£¬±ØÐëÑ¡ÓÃ&xx;·½Ê½À´×ªÒ壬¿ÉÎÒÕÒ±éXMLҲû·¢ÏÖÕâЩ¡£
ºóÀ´ÎÒ¶ÀÐÐÅųý£¬²Å·¢ÏÖÓÐÒ»¸öÔªËصÄÊôÐÔֵΪÓГ|”£¬È¥³ýºó¾ÍÕý³£ÁË¡£ÎÒÕæÊǾõµÃÆæ¹Ö£¬ÍøÉÏҲûÓÐ˵ ......
ajaxÖÐʹÓÃpost ·½Ê½Ìá½»±íµ¥Ê±ÄÜÌá½»¶à´ï2GBµÄÄÚÈÝ,¶øGET·½·¨Ö»ÄÜÌá½»×î¶à512KBµÄÄÚÈÝ.ÒÔÏÂÊÇajax POSTÌá½»µÄÀý×Ó.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head& ......
Ç°¼¸ÌìÔÚFirebugÀ©Õ¹¿ª·¢Ò»ÎÄÖоÍÌáµ½¹ýFirephpÕâ¸ö»ùÓÚFirebugµÄ²å¼þ£¬Í¨¹ýʹÓÃFirephpÄã¿ÉÒÔÔÚFirebugµÄConsoleÀ¸Öп´µ½Òªµ÷ÊÔµÄÊý¾Ý£¬¶ø²»Ó°Ïìphp³ÌÐòµÄÕý³£Ö´ÐУ¬ËùÒÔ˵£¬ÕⶫÎ÷¶ÔÓÚAjax¿ª·¢ÊǺÜÓаïÖúµÄ£¡ÏÂÃæÒ»ÆðÀ´¿´ÏÂFirephpµÄʹÓ÷½·¨¡£
µÚÒ»²½£º°²×°
1.Èç¹ûÄãµÄFireFoxûÓÐFirebugÕâ¸ö²å¼þµÄ»°£¬Ê×ÏÈÒª°²×°Fire ......
»ùÓÚJQuery¿ò¼ÜµÄAJAX
Ç°¼¸Ìì·¢Á˸öÌù£¬·ÖÏíÁËprototype¿ò¼Ü¹ØÓÚAJAX·½ÃæµÄѧϰ¹ý³Ì¡£È»ºóÓÐÈË˵jquery¿ò¼Ü¸ü·½±ã¡£
ÕýºÃÏîÄ¿ÖÐ×¼±¸Ê¹ÓÃthickbox£¬ÓÚÊǸɴàÅ×Æúprototype.js£¬¿´Æðjquery.jsÁË¡£JQueryȷʵ²»´í£¬Ìå»ý±È PrototypeСÁËÐí¶à£¬¶øÇÒʹÓÃÆðÀ´¸ü·½±ã¸üÁé»î¡£ÓÐÈË˵PrototypeÏñJAVA£¬Õýͳ£»¶øJQueryÏñRuby£¬Áé»î£ ......