结合 ajax overlib

overlib很不错 如果和ajax结合下那就更完美了

不知道为什么官方没有这样的插件

也许很简单 自己写一个

/*

merge ajax and overlib

by T.G. (farmer1992@gmail.com)

*/

function oajax_makexmlHttp()

{

var xmlHttp = false;

try {

xmlHttp = new ActiveXObject(“Msxml2.XMLHTTP”);

} catch (e) {

try {

xmlHttp = new ActiveXObject(“Microsoft.XMLHTTP”);

} catch (e2) {

xmlHttp = false;

}

}

if (!xmlHttp && typeof XMLHttpRequest != ‘undefined’) {

xmlHttp = new XMLHttpRequest();

}

return xmlHttp;

}

function oajax_get(url){

try

{

xmlHttp=oajax_makexmlHttp();

xmlHttp.open(“GET”, url, true);

xmlHttp.onreadystatechange = function() {

if (xmlHttp.readyState == 4) {

var response = xmlHttp.responseText;

document.getElementById(“overlib_ajax_div”).innerHTML= response;

}

};

// Send the request

xmlHttp.send(null);

}

catch(e){

alert(e.message);

}

}

function overlib_ajax(url)

{

var div=”<div id=\”overlib_ajax_div\”>Loading…</div>”;

oajax_get(url);

overlib(div,VAUTO,HAUTO,FULLHTML);

}

Social tagging:

发表评论