var LF = {};
LF.version = '1.0.0';
//전체局函数
function $(objName) {
return document.getElementById(objName);
}
function $name(objName) {
return document.getElementsByName(objName);
}
function $tag(objName) {
return document.getElementsByTagName(objName);
}
//广告swf flashWrite('SW/2009/HomeGroBuy.swf','950','70','navigation', '##ffffff', 'menuNum=0', '투명한');
function flashWrite(url,w,h,id,bg,vars,win){
var flashStr=
"
";
document.write(flashStr);
}
//广告图文 imgWrite('images/pic04.jpg', '780', '90', 'http://www.lfang.com/wzzt/2009/lgzt/');
function imgWrite(url,w,h,linkUrl){
var flashStr= "";
if (linkUrl=="")
flashStr="
" ;
그 외
flashStr="
" "" "";
document.write(flashStr);
}
//AJAX操작
LF.ajax={
getXmlhttp : function() {
var http_request;
if(window.XMLHttpRequest) {
http_request = new XMLHttpRequest();
if (http_request.overrideMimeType) {
http_request.overrideMimeType("text/xml");
}
}
else if (window.ActiveXObject) {
try {
http_request = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
http_request = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {}
}
}
if (!http_request) {
window.alert("XMLHttpRequest 객체를 생성할 수 없습니다.");
널을 반환합니다.
}
http_request를 반환합니다.
},
loadAJAXTab : 함수(url){// 一般是DIV
try {
var xhttp=LF.ajax.getXmlhttp();
xhttp.open("GET",url,false);
xhttp.send(null);
if (xhttp.readyState == 0)return "0初始化中......";
if (xhttp.readyState == 1)return "1初始化中......";
if (xhttp.readyState == 2)return "2初始化中......";
if (xhttp.readyState == 3)return "3初始化中......";
if(xhttp.readyState == 4 && (xhttp.status==200)){
var resText=xhttp.responseText;
if (resText!="")resText를 반환합니다.
}
}catch (e) {
return e;
}
},
dataSubmit:function(url,urlParameter,method){ //ajax post提交数据
try{
if(method==""){method="POST ";}
var xhttp=LF.ajax.getXmlhttp();
xhttp.open(메소드, url urlParameter, false);
xhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
xhttp.send(null);
if (xhttp.readyState == 0)return "0初始化中......";
if (xhttp.readyState == 1)return "1初始化中......";
if (xhttp.readyState == 2)return "2初始化中......";
if (xhttp.readyState == 3)return "3初始化中......";
if (xhttp.readyState == 4 && xhttp.status == 200)return xhttp.responseText;
}catch(e){
return e;
}
}
};
//工具
LF.util = {
setCookie:function (이름, 값){//写cookies
var Days = 30;
var exp = new Date();
exp.setTime(exp.getTime() 일*24*60*60*1000);
document.cookie = name "=" escape (value) ";expires=" exp.toGMTString();
},
getCookie:function (name){//读取cookies
var arr,reg=new RegExp("(^| )" name "=([^;]*)(;| $)");
if(arr=document.cookie.match(reg)) return unescape(arr[2]);
그렇지 않으면 null을 반환합니다.
},
delCookie:function(이름){//删除cookies
var exp = new Date();
exp.setTime(exp.getTime() - 1);
var cval=getCookie(이름);
if(cval!=null) document.cookie= name "=" cval ";expires=" exp.toGMTString();
},
escape:function (html) {//过滤html
html = html.replace(/&/g, "&");
html = html.replace(/html = html.replace(/>/g, ">");
html = html.replace(/xA0/g, " ");
html = html.replace(/x20/g, " ");
html 반환;
}
};