$(document).ready(function(e) {
if (!document.getElementById("SS_HiddenFrm")) $("body").append("");
$(".jsE_submit").click(function(){
var form_name = $($(this).attr("fid"));
//if (document.form_name.onsubmit() != false) {}document.form_name.submit();
$(form_name).submit();
});
});
function setCookie(c_name, value, expiredays)
{
if (typeof(expiredays) == "undefined") expiredays = 86400;
var exdate = new Date();
exdate.setDate(exdate.getDate() + expiredays);
document.cookie = c_name + "=" + escape(value) + ((expiredays == null) ? "" : ";expires=" + exdate.toGMTString());
}
function ReloadArea(obj, o_id, script, Area, Country, Province, City, District)
{
// 页面必须引用 JQuery 库
if (!obj || typeof(obj.value) == "undefined" || obj.value == "") return;
if (typeof($(obj).attr("id")) == "undefined" || $(obj).attr("id") == "") $(obj).attr("id", $(obj).attr("name"));
if (typeof(o_id) == "undefined" || o_id == "") o_id = -1;
if (typeof(script) == "undefined" || script == "") script = "/inc/get_class_name.php";
if (typeof(Area) == "undefined" || Area == "") Area = "Area";
if (typeof(Country) == "undefined" || Country == "") Country = "Country";
if (typeof(Province) == "undefined" || Province == "") Province = "Province";
if (typeof(City) == "undefined" || City == "") City = "City";
if (typeof(District) == "undefined" || District == "") District = "District";
//AJAX请求
switch (obj.id)
{
case (Province):
//省
$("#" + City).attr("disabled", true);
$("#" + District).attr("disabled", true);
$("#" + City).find("option").not(":first").remove();
$("#" + District).find("option").not(":first").remove();
$("#" + City).find("option:first").text(" 正在载入... ");
break;
case (City):
//市
$("#" + District).attr("disabled", true);
$("#" + District).find("option").not(":first").remove();
//document.getElementById("District").length = 1;
$("#" + District).find("option:first").text(" 正在载入... ");
//document.getElementById("District").options[0].text = " 正在载入... ";
break;
//case "district":
////区
//break;
}
$.ajax({
url: script,
type: "POST",
data: "o_id=" + o_id + "&fID=" + obj.value,
success: function(result, type, exception){
switch (obj.id)
{
case Province:
//省
try
{
$("#" + City).append(result);
$("#" + City).find("option").eq(0).text("-=请选择=-");
$("#" + District).find("option").eq(0).text("-=请选择=-");
$("#" + City).attr("disabled", false);
$("#" + District).attr("disabled", false);
}catch(e){
alert("出错了:" + e.message);
}
break;
case City:
//市
try
{
$("#" + District).append(result);
$("#" + District).find("option").eq(0).text("-=请选择=-");
$("#" + District).attr("disabled", false);
}catch(e){
alert("出错了:" + e.message);
}
break;
//case "district":
////区
//break;
}
},
error: function (err, type, exception){
//alert(err.responseText);
alert("Error");
}
});
}
function getMore(e_obj, c_obj)
{
//
$(e_obj).css("cursor", "pointer");
var get_more = false;
$(e_obj).click(function(){
if ($(e_obj).css("cursor") == "not-allowed") return;
if (get_more)
{
//alert("鼠标也是要钱买的呀,不要狂戳啊!");
return;
}
var regExp = /(page=\d+)/g;
eval("var " + $(this).attr("para").match(regExp));
page = parseInt(page) + 1;
var para = $(this).attr("para").replace(regExp, "page=" + page);
$.ajax({
type:"GET",
url:"?",
data: para,
scriptCharset:"gb2312",
success: function(result){
get_more = false;
if (result != "")
{
$(c_obj).html($(c_obj).html() + result);
$(e_obj).attr("para", para);
bindClick();
}else{
$(e_obj).attr("title", "没有更多").css({color:"#ccc",cursor:"not-allowed"});
}
},
error: function(err){
get_more = false;
alert(err.message);
}
});
get_more = true;
});
}