This is replaced ajaxed.js instead of prototype
/*
ajax.js
2007-09-08 17:22
version 0.1
Licensed under the Lesser GNU (LGPL) open source license version
2.1.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
ajaxed is a good libary for the good old asp.
This file is a client side code for ajaxed.
requirement:
jQuery 1.1.4
jQuery Form Plugin
DO NOT include prototype.js
usage:
replace ajaxed/class_ajaxPage/ajax.js with this file.
see
http://www.webdevbros.net/ajaxed/ for more detail about
ajaxed.
see
http://www.prototypejs.org/ for detail about prototye.
see
http://jquery.com/ for detail about jquery.
see
http://www.malsup.com/jquery/form/ for detail about jQuery
Form Plugin
Contact me if you have problems installing this file.
Do please,give me feedback.
enjoy.
happyjake#
gmail.com
*/
String.prototype.startsWith = function(str)
{return (this.match("^"+str)==str)}
String.prototype.endsWith = function(str)
{return (this.match(str+"$")==str)}
function ajaxed() {};
ajaxed.prototype.indicator = document.createElement('div');
$(ajaxed.prototype.indicator).ajaxStart(function(){
s = ajaxed.prototype.indicator.style;
s.background = "#cc0000";
s.color = "#fff";
s.position = "absolute";
s.right = "4px";
s.top = "4px";
document.body.appendChild(ajaxed.prototype.indicator);
});
$(ajaxed.prototype.indicator).ajaxStop(function(){
document.body.removeChild(ajaxed.prototype.indicator);
});
//optional: onComplete, url (because of bug in iis5
http://support.microsoft.com/kb/216493)
ajaxed.callback = function(theAction, func, params, onComplete,
formid, url) {
uri = window.location.href.replace(/#.*$/ig, '');
alert(url);
if (ajaxed.prototype.debug) ajaxed.debug("Action (to be handled in
callback):\n\n" + theAction);
if (uri.endsWith('/') && url) uri += url;
if (url) uri = url;
if (params) {
params=jQuery.extend({}, params, {PageAjaxed: theAction});
} else {
if ($('#' + formid).length) {
params = $('#' + formid).serialize() + "&PageAjaxed=" + theAction;
} else {
if ($('#frm').length) {
params = $('#frm').serialize() + "&PageAjaxed=" + theAction;
} else {
params = {};
}
}
}
$.ajax({
type:'post',
url:uri,
cache:false,
data:params,
success:function(data, textStatus) {
if (ajaxed.prototype.debug) ajaxed.debug("Response on callback:\n
\n" + data);
if (!data.startsWith('{ "root":') && !data.startsWith('pagePart:'))
{
ajaxed.callbackFailure( data );
} else if (data.startsWith('pagePart:')) {
var content = data.replace(/^pagePart:/g, '');
if (typeof func == "string") return $('#'+func).html(content);
if (func) func(content);
} else {
var json = eval("(" + data + ")");
if (func) func(json.root);
}
},
error:ajaxed.callbackFailure,
complete:onComplete
});
}
ajaxed.callbackFailure = function(data) {
friendlyMsg = data;
friendlyMsg = friendlyMsg.replace(new RegExp("(<head[\\s\\S]*?</
head>)|(<script[\\s\\S]*?</script>)", "gi"), "");
friendlyMsg = friendlyMsg.replace(new RegExp("/<\/?[^>]+>/gi"),
'');
friendlyMsg = friendlyMsg.replace(new RegExp("[\\s]+", "gi"), "
");
alert(friendlyMsg);
}
ajaxed.debug = function(msg){
alert("<DEBUG MESSAGE>\n\n" + msg);
}
And you have to change ajaxed/class_ajaxedPage/ajaxedPage.asp
293 public sub ajaxedHeader(params)
294 'if loadPrototypeJS then loadJSFile(lib.path("prototypejs/
prototype.js")) ORIGINAL LINE
294 if loadPrototypeJS then loadJSFile("
http://ajax.googleapis.com/
ajax/libs/jquery/1.2.6/jquery.min.js") ' i'm load from google ajax api
tools CDN.