docpad plugins server.extend argument options not containing any express middleware with last version of docpad - docpad

I faced problems using minicms docpad plugin with last version of docpad. This plugin implements server.extend function which is being passed an opts object containing the express module used by docpad (during its plugin initialisation process). Minicms plugin is making use of a bunch of expressJS middleware :
express.static()
express.cookieParser()
express.cookieSession()
Unfortunately none of those middleware functions are available in the opts.express object and i'm wondering if there's been some changes in the recent docpad versions. Is there any workaround or docpad configuration i should be aware of ?
minicms.plugin.js code
// Generated by IcedCoffeeScript 1.3.3g
(function() {
var YAML, applyContext, cc, deepCopy, exec, fs, gm, sessionBridge, shellEscape, slugify, uuid,
__hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
slugify = require('./utils/slugify');
cc = require('coffeecup');
uuid = require('node-uuid');
gm = require('gm');
fs = require('fs');
exec = require('child_process').exec;
shellEscape = require('./utils/shellEscape');
deepCopy = require('owl-deepcopy').deepCopy;
YAML = require('yamljs');
applyContext = require('./utils/applyContext');
sessionBridge = require('./utils/sessionBridge');
module.exports = function(BasePlugin) {
var MinicmsPlugin;
return MinicmsPlugin = (function(_super) {
__extends(MinicmsPlugin, _super);
function MinicmsPlugin() {
return MinicmsPlugin.__super__.constructor.apply(this, arguments);
}
MinicmsPlugin.prototype.name = 'minicms';
MinicmsPlugin.prototype.config = {
prefix: {
url: 'cms',
meta: 'cms'
},
validate: require('./utils/validate'),
sanitize: require('./utils/sanitize')
};
MinicmsPlugin.prototype.docpadReady = function(opts) {
return this.docpad.action('watch', {}, function(err) {
var _ref;
if (err) {
process.stderr.write(("" + ((_ref = err.message) != null ? _ref : err)).trim() + "\n");
}
return this.docpad.log("Force watching file for minicms.");
});
};
MinicmsPlugin.prototype.serverExtend = function(opts) {
var app, config, docpad, express;
app = opts.server;
express = opts.express; // express module
console.log(opts.express._router.middleware);
docpad = this.docpad;
config = this.config;
exec("rm -rf " + (shellEscape(docpad.config.srcPath + '/files/tmp')), function() {});
app.use('/' + this.config.prefix.url, express["static"](__dirname + '/static')); // express.static middleware
if (!(this.config.secret != null)) {
throw "Secret is required for cookie sessions (minicms)";
}
app.use(express.cookieParser()); // express.cookieParser middleware
app.use(express.cookieSession({ // express.cookieSession middleware
secret: this.config.secret
}));
app.get('/' + this.config.prefix.url + '/logout', require('./routes/logout').bind(this));
app.get('/' + this.config.prefix.url + '/login', require('./routes/login').bind(this));
app.post('/' + this.config.prefix.url + '/login', require('./routes/loginSubmit').bind(this));
app.get('/' + this.config.prefix.url, require('./routes/root').bind(this));
app.get('/' + this.config.prefix.url + '/:content/list', require('./routes/list').bind(this));
app.get('/' + this.config.prefix.url + '/:content/edit', require('./routes/edit').bind(this));
app.post('/' + this.config.prefix.url + '/:content/edit', require('./routes/edit').bind(this));
app.post('/' + this.config.prefix.url + '/generate', require('./routes/generate').bind(this));
console.log('/' + this.config.prefix.url + '/:content/:field/upload');
app.post('/' + this.config.prefix.url + '/:content/:field/upload', require('./routes/upload').bind(this));
};
return MinicmsPlugin;
})(BasePlugin);
};
}).call(this);

Related

nativescript-background-http issue

I tried implementing image upload page for my app, but unfortunately the request is not reaching the server. I double checked this using tcpdump on the server side. The code doesnt seem to process beyond session.uploadFile in sendImages function
Please let me know if there is any issue with the code
var imageSource = require("image-source");
var frameModule = require("ui/frame");
var Observable = require("data/observable").Observable;
var fromObject = require("data/observable").fromObject;
var ObservableArray = require("data/observable-array").ObservableArray;
var platformModule = require("platform");
var permissions = require("nativescript-permissions");
var imagepickerModule = require("nativescript-imagepicker");
var bghttpModule = require("nativescript-background-http");
var session = bghttpModule.session("image-upload");
var fs = require("file-system");
var page;
var imageName;
var counter = 0;
function pageLoaded(args) {
page = args.object;
}
function onSelectSingleTap(args) {
var context = imagepickerModule.create({
mode: "single"
});
if (platformModule.device.os === "Android" && platformModule.device.sdkVersion >= 23) {
permissions.requestPermission(android.Manifest.permission.READ_EXTERNAL_STORAGE, "I need these permissions to read from storage")
.then(function () {
console.log("Permissions granted!");
startSelection(context);
})
.catch(function () {
console.log("Uh oh, no permissions - plan B time!");
});
} else {
startSelection(context);
}
}
function sendImages(uri, fileUri) {
imageName = extractImageName(fileUri);
var request = {
url: "http://maskingIpForPost:8081/mobilepic/ctk/uploadpic",
method: "POST",
headers: {
"Content-Type": "application/octet-stream",
"file-Name": imageName,
"uid": 30
},
description: "{ 'uploading': " + imageName + " }"
};
var task = session.uploadFile(fileUri, request);
task.on("progress", progress);
task.on("error", error);
task.on("complete", complete);
task.on("responded", responded);
function responded(e) {
console.log("eventName: " + e.eventName);
console.log("data: " + e.data);
}
function progress(e) {
console.log("currentBytes: " + e.currentBytes);
console.log("totalBytes: " + e.totalBytes);
console.log("eventName: " + e.eventName);
}
function error(e) {
console.log("eventName: " + e.eventName);
console.log("eventName: " + e.responseCode);
console.log("eventName: " + e.response);
}
function complete(e) {
console.log("eventName: " + e.eventName);
console.log("response: " + e.responseCode);
}
return task;
}
function startSelection(context) {
context
.authorize()
.then(function () {
return context.present();
})
.then(function (selection) {
selection.forEach(function (selected_item) {
var localPath = null;
if (platformModule.device.os === "Android") {
localPath = selected_item._android;
} else {
// selected_item.ios for iOS is PHAsset and not path - so we are creating own path
let folder = fs.knownFolders.documents();
let path = fs.path.join(folder.path, "Test" + counter + ".png");
//let saved = imagesource.saveToFile(path, "png");
localPath = path;
}
alert("final path " + localPath);
if (localPath) {
var task = sendImages("Image" + counter + ".png", localPath);
//mainViewModel.get("items").push(fromObject({ thumb: imagesource, uri: "Image" + counter + ".png", uploadTask: task }));
}
counter++;
});
}).catch(function (e) {
console.log(e.eventName);
});
}
function extractImageName(fileUri) {
var pattern = /[^/]*$/;
var imageName = fileUri.match(pattern);
return imageName;
}
exports.pageLoaded = pageLoaded;
exports.onSelectSingleTap = onSelectSingleTap;
On Further research found the following
net.gotev.uploadservice.UploadService is undefined in background-http.android.js. At this moment i am not sure what this means. Would appreciate if anyone has idea about this
You need to change the following line in your code.
var session = bghttpModule.session("image-upload");
It has to be file upload
var session = bghttpModule.session("file-upload");
Just tested your code by using Azure Blob Storage PUT url at my side and got the below response.
ActivityManager: START u0 {act=android.intent.action.OPEN_DOCUMENT typ=image/* cmp=com.android.documentsui/.DocumentsActivity (has extras)} from pid 2835
JS: currentBytes: 4096
JS: totalBytes: 25220
JS: eventName: progress
JS: currentBytes: 25220
JS: totalBytes: 25220
JS: eventName: progress
JS: currentBytes: 25220
JS: totalBytes: 25220
JS: eventName: progress
JS: eventName: responded
JS: data:
JS: eventName: complete
JS: response: 201
thanks for the quick response, i tried running it on a emulator and i faced the above mentioned issue, i tried the same by connecting a device and it worked just fine.

Execute multiple http request - Parse Cloud Code

i have an array of stores, where the address and some other things are stored.
Now I want to iterate through this array and geocode the lat / lng coords and save them to the database.
With the code below I get double or triple entries of the same store. Do I miss something with the scope here?
Thanks!
var promises = [];
data.forEach(function (element, index)
{
var addressString = element.plz + " " + element.stadt + "," + element.adresse;
var url = encodeURI("https://maps.googleapis.com/maps/api/geocode/json?address=" +
addressString);
var promise = Parse.Cloud.httpRequest({
method: "GET",
url:url
}).then(function (http) //SUCCESS
{
var geocodedObject = new Parse.Object("GeocodedStores");
geocodedObject.set("storeID", element.id);
geocodedObject.set("Latitude", http.data.results[0].geometry.location.lat);
geocodedObject.set("Longitude", http.data.results[0].geometry.location.lng);
return geocodedObject.save(null, {
useMasterKey: true
});
},
function (http, error)
{
response.error(error);
});
promises.push(promise);
});
return Parse.Promise.when(promises);
Finally found a working solution. It looked like it was a problem with the scope. I put the code in a seperate function and added this returned promise to an array.
var fn = function(element, geocodedObject)
{
var addressString = element.plz + " " + element.stadt + "," + element.adresse;
var url = encodeURI("https://maps.googleapis.com/maps/api/geocode/json?address=" +
addressString);
Parse.Cloud.httpRequest({
method: "GET",
url: url
}).then(function(http)
{
geocodedObject.set("storeID", element.id);
geocodedObject.set("Latitude", http.data.results[0].geometry.location.lat);
geocodedObject.set("Longitude", http.data.results[0].geometry.location.lng);
geocodedObject.set("address", addressString);
return geocodedObject.save(null, {
useMasterKey: true
});
});
}
var promises = [];
for (var k = 0;k<data.length;k++)
{
var geocodedObject = new Parse.Object("GeocodedStores");
promises.push(fn(data[k], geocodedObject));
}
Parse.Promise.when(promises).then(function () {
response.success("DONE");
});

Invoking a webpage using Lambda with node.js

I am learning AWS and as part of that I am trying to create a Lambda using node.js.
I am trying to invoke a webpage using the following, please correct me. What I am missing?
const opn = require('opn');
opn('http://google.com', {app: 'firefox'});
I wrote up a post detailing how to set this up if you only want to hit URLs with Lambda. You can find it here.
If you already know how to setup IAM permissions and scheduling with CloudWatch, the code I used accomplished this with Node.js 6.10 runtime:
exports.handler = (event, context, callback) => {
var urls = event.urls;
var http = require("http");
var https = require("https");
for (var i = 0; i < urls.length; i++) {
var protocol = urls[i].Protocol;
var domain = urls[i].Domain;
var queryString = urls[i].QueryString;
var url = protocol + "://" + domain + queryString;
if (protocol.toLowerCase() === "http") {
var j = i;
http.get(url, function(res) {
// Get around async.
var requestUrl = urls[j].Protocol + "://" + urls[j].Domain + urls[j].QueryString;
console.log("Response from " + requestUrl + ": ");
console.log(res.statusCode);
console.log(res.statusMessage);
}).on('error', function(e) {
console.log("Got error: " + e.message);
});
} else if (protocol.toLowerCase() === "https") {
https.get(url, function(res) {
var j = i;
// Get around async.
var requestUrl = urls[j].Protocol + "://" + urls[j].Domain + urls[j].QueryString;
console.log("Response from " + requestUrl + ": ");
console.log(res.statusCode);
console.log(res.statusMessage);
}).on('error', function(e) {
console.log("Encountered error: " + e.message);
});
}
// Force break due to async -> output.
if ((i+1) == urls.length) {
break;
}
}
};
You would define the URLs you would like to invoke by passing an event object that is similar to the following:
{"urls": [{
"Protocol": "HTTP",
"Domain": "www.aaronmedacco.com",
"QueryString": ""}, {
"Protocol": "HTTPS",
"Domain": "www.google.com",
"QueryString": "?key=value"}]}
Again, if you want a step by step, check out this post. Simple to set up.

DOJO/Ajax: Dynamic Loading of Content & DOJO Upgrade

In my application I am expected to show come configurations on UI. Currently appication makes a DOJO call and displays all the configs in UI. But, we are facing time out issues in case of huge configs say 5000 or more, which subsequently takes more time to load the page and application gets timed out since the default time for DOJO is around 3mins.
Solution: We are planning to make subsequent AJAX calls and display 50 rows of configurations at a time. This would mean, that after displaying 50 rows of configs, application will make another AJAX call until all the configs are loaded on the page. This will ensure that DOJO call is not getting timed out. We are planning to move forward with DOJO.xhrGet or DOJO.xhrPost which is a part of request package in DOJO 1.8.
Now, the issue here is that my application is configured with very old version of DOJO. Since, we want to include new request methods which are introduced in DOJO 1.8, what changes will be required here?
We have tried by including the request methods in DOJO.JS but we can see that it impacts other application aspects. Can you please let me know the steps required to include this new package in DOJO.JS?? For reference, please find a snippet of my DOJO.JS.
Any suggestions would be of great help. Thanks!!! :)
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
http://dojotoolkit.org/community/licensing.shtml
*/
/*
This is a compiled version of Dojo, built for deployment and not for
development. To get an editable version, please visit:
http://dojotoolkit.org
for documentation and information on getting the source.
*/
if (typeof dojo == "undefined") {
var dj_global = this;
function dj_undef(_1, _2) {
if (_2 == null) {
_2 = dj_global;
}
return (typeof _2[_1] == "undefined");
}
if (dj_undef("djConfig")) {
var djConfig = {};
}
if (dj_undef("dojo")) {
var dojo = {};
}
dojo.version = {major:0,minor:3,patch:1,flag:"",revision:Number("$Rev: 4342 $".match(/[0-9]+/)[0]),toString:function() {
with (dojo.version) {
return major + "." + minor + "." + patch + flag + " (" + revision + ")";
}
}};
dojo.evalProp = function(_3, _4, _5) {
return (_4 && !dj_undef(_3, _4) ? _4[_3] : (_5 ? (_4[_3] = {}) : undefined));
};
dojo.parseObjPath = function(_6, _7, _8) {
var _9 = (_7 != null ? _7 : dj_global);
var _a = _6.split(".");
var _b = _a.pop();
for (var i = 0,l = _a.length; i < l && _9; i++) {
_9 = dojo.evalProp(_a[i], _9, _8);
}
return {obj:_9,prop:_b};
};
dojo.evalObjPath = function(_d, _e) {
if (typeof _d != "string") {
return dj_global;
}
if (_d.indexOf(".") == -1) {
return dojo.evalProp(_d, dj_global, _e);
}
var _f = dojo.parseObjPath(_d, dj_global, _e);
if (_f) {
return dojo.evalProp(_f.prop, _f.obj, _e);
}
return null;
};
dojo.errorToString = function(_10) {
if (!dj_undef("message", _10)) {
return _10.message;
} else {
if (!dj_undef("description", _10)) {
return _10.description;
} else {
return _10;
}
}
};
dojo.raise = function(_11, _12) {
if (_12) {
_11 = _11 + ": " + dojo.errorToString(_12);
}
try {
dojo.hostenv.println("FATAL: " + _11);
}
catch(e) {
}
throw Error(_11);
};
dojo.debug = function() {
};
dojo.debugShallow = function(obj) {
};
dojo.profile = {start:function() {
},end:function() {
},stop:function() {
},dump:function() {
}};
function dj_eval(_14) {
return dj_global.eval ? dj_global.eval(_14) : eval(_14);
}
dojo.unimplemented = function(_15, _16) {
var _17 = "'" + _15 + "' not implemented";
if (_16 != null) {
_17 += " " + _16;
}
dojo.raise(_17);
};
dojo.deprecated = function(_18, _19, _1a) {
var _1b = "DEPRECATED: " + _18;
if (_19) {
_1b += " " + _19;
}
if (_1a) {
_1b += " -- will be removed in version: " + _1a;
}
dojo.debug(_1b);
};
dojo.inherits = function(_1c, _1d) {
if (typeof _1d != "function") {
dojo.raise("dojo.inherits: superclass argument [" + _1d + "] must be a function (subclass: [" + _1c + "']");
}
_1c.prototype = new _1d();
_1c.prototype.constructor = _1c;
_1c.superclass = _1d.prototype;
_1c["super"] = _1d.prototype;
};
dojo.render = (function() {
function vscaffold(_1e, _1f) {
var tmp = {capable:false,support:{builtin:false,plugin:false},prefixes:_1e};
for (var _21 in _1f) {
tmp[_21] = false;
}
return tmp;
}
return {name:"",ver:dojo.version,os:{win:false,linux:false,osx:false},html:vscaffold(["html"], ["ie","opera","khtml","safari","moz"]),svg:vscaffold(["svg"], ["corel","adobe","batik"]),vml:vscaffold(["vml"], ["ie"]),swf:vscaffold(["Swf","Flash","Mm"], ["mm"]),swt:vscaffold(["Swt"], ["ibm"])};
})();
dojo.hostenv = (function() {
var _22 = {isDebug:false,allowQueryConfig:false,baseScriptUri:"",baseRelativePath:"",libraryScriptUri:"",iePreventClobber:false,ieClobberMinimal:true,preventBackButtonFix:true,searchIds:[],parseWidgets:true};
if (typeof djConfig == "undefined") {
djConfig = _22;
} else {
for (var _23 in _22) {
if (typeof djConfig[_23] == "undefined") {
djConfig[_23] = _22[_23];
}
}
}
return {name_:"(unset)",version_:"(unset)",getName:function() {
return this.name_;
},getVersion:function() {
return this.version_;
},getText:function(uri) {
dojo.unimplemented("getText", "uri=" + uri);
}};
})();
dojo.hostenv.getBaseScriptUri = function() {
if (djConfig.baseScriptUri.length) {
return djConfig.baseScriptUri;
}
var uri = new String(djConfig.libraryScriptUri || djConfig.baseRelativePath);
if (!uri) {
dojo.raise("Nothing returned by getLibraryScriptUri(): " + uri);
}
var _26 = uri.lastIndexOf("/");
djConfig.baseScriptUri = djConfig.baseRelativePath;
return djConfig.baseScriptUri;
};
(function() {
var _27 = {pkgFileName:"__package__",loading_modules_:{},loaded_modules_:{},addedToLoadingCount:[],removedFromLoadingCount:[],inFlightCount:0,modulePrefixes_:{dojo:{name:"dojo",value:"src"}},setModulePrefix:function(_28, _29) {
this.modulePrefixes_[_28] = {name:_28,value:_29};
},getModulePrefix:function(_2a) {
var mp = this.modulePrefixes_;
if ((mp[_2a]) && (mp[_2a]["name"])) {
return mp[_2a].value;
}
return _2a;
},getTextStack:[],loadUriStack:[],loadedUris:[],post_load_:false,modulesLoadedListeners:[],unloadListeners:[],loadNotifying:false};
for (var _2c in _27) {
dojo.hostenv[_2c] = _27[_2c];
}
})();

Error in jquery.handleErrors when using IE

I use this AJAX jQuery plugin in our site. When I test it using IE, I'm getting this error ( Object doesn't support property or method 'handleError') that pertains to this line:
jQuery.handleError(s, xml, null, e);
I'm using 1.7.1 version of jQuery. How can I replace it?
Here's the full code
jQuery.extend({
createUploadIframe: function (id, uri) {
//create frame
var frameId = 'jUploadFrame' + id;
var iframeHtml = '<iframe id="' + frameId + '" name="' + frameId + '" style="position:absolute; top:-9999px; left:-9999px"';
if (window.ActiveXObject) {
if (typeof uri == 'boolean') {
iframeHtml += ' src="' + 'javascript:false' + '"';
} else if (typeof uri == 'string') {
iframeHtml += ' src="' + uri + '"';
}
}
iframeHtml += ' />';
jQuery(iframeHtml).appendTo(document.body);
return jQuery('#' + frameId).get(0);
},
createUploadForm: function (id, fileElementId, data) {
//create form
var formId = 'jUploadForm' + id;
var fileId = 'jUploadFile' + id;
var form = jQuery('<form action="" method="POST" name="' + formId + '" id="' + formId + '" enctype="multipart/form-data"></form>');
if (data) {
for (var i in data) {
jQuery('<input type="hidden" name="' + i + '" value="' + data[i] + '" />').appendTo(form);
}
}
var oldElement = jQuery('#' + fileElementId);
var newElement = jQuery(oldElement).clone();
jQuery(oldElement).attr('id', fileId);
jQuery(oldElement).before(newElement);
jQuery(oldElement).appendTo(form);
//set attributes
jQuery(form).css('position', 'absolute');
jQuery(form).css('top', '-1200px');
jQuery(form).css('left', '-1200px');
jQuery(form).appendTo('body');
return form;
},
ajaxFileUpload: function (s) {
// TODO introduce global settings, allowing the client to modify them for all requests, not only timeout
s = jQuery.extend({}, jQuery.ajaxSettings, s);
var id = new Date().getTime()
var form = jQuery.createUploadForm(id, s.fileElementId, (typeof (s.data) == 'undefined' ? false : s.data));
var io = jQuery.createUploadIframe(id, s.secureuri);
var frameId = 'jUploadFrame' + id;
var formId = 'jUploadForm' + id;
// Watch for a new set of requests
if (s.global && !jQuery.active++) {
jQuery.event.trigger("ajaxStart");
}
var requestDone = false;
// Create the request object
var xml = {}
if (s.global) jQuery.event.trigger("ajaxSend", [xml, s]);
// Wait for a response to come back
var uploadCallback = function (isTimeout) {
var io = document.getElementById(frameId);
try {
if (io.contentWindow) {
xml.responseText = io.contentWindow.document.body ? io.contentWindow.document.body.innerHTML : null;
xml.responseXML = io.contentWindow.document.XMLDocument ? io.contentWindow.document.XMLDocument : io.contentWindow.document;
} else if (io.contentDocument) {
xml.responseText = io.contentDocument.document.body ? io.contentDocument.document.body.innerHTML : null;
xml.responseXML = io.contentDocument.document.XMLDocument ? io.contentDocument.document.XMLDocument : io.contentDocument.document;
}
} catch (e) {
jQuery.handleError(s, xml, null, e);
}
if (xml || isTimeout == "timeout") {
requestDone = true;
var status;
try {
status = isTimeout != "timeout" ? "success" : "error";
// Make sure that the request was successful or notmodified
if (status != "error") {
// process the data (runs the xml through httpData regardless of callback)
var data = jQuery.uploadHttpData(xml, s.dataType);
// If a local callback was specified, fire it and pass it the data
if (s.success) s.success(data, status);
// Fire the global callback
if (s.global) jQuery.event.trigger("ajaxSuccess", [xml, s]);
} else jQuery.handleError(s, xml, status);
} catch (e) {
status = "error";
jQuery.handleError(s, xml, status, e);
}
// The request was completed
if (s.global) jQuery.event.trigger("ajaxComplete", [xml, s]);
// Handle the global AJAX counter
if (s.global && !--jQuery.active) jQuery.event.trigger("ajaxStop");
// Process result
if (s.complete) s.complete(xml, status);
jQuery(io).unbind()
setTimeout(function () {
try {
jQuery(io).remove();
jQuery(form).remove();
} catch (e) {
jQuery.handleError(s, xml, null, e);
}
}, 100)
xml = null
}
}
// Timeout checker
if (s.timeout > 0) {
setTimeout(function () {
// Check to see if the request is still happening
if (!requestDone) uploadCallback("timeout");
}, s.timeout);
}
try {
var form = jQuery('#' + formId);
jQuery(form).attr('action', s.url);
jQuery(form).attr('method', 'POST');
jQuery(form).attr('target', frameId);
if (form.encoding) {
jQuery(form).attr('encoding', 'multipart/form-data');
} else {
jQuery(form).attr('enctype', 'multipart/form-data');
}
jQuery(form).submit();
} catch (e) {
jQuery.handleError(s, xml, null, e);
}
jQuery('#' + frameId).load(uploadCallback);
return {
abort: function () {}
};
},
uploadHttpData: function (r, type) {
var data = !type;
data = type == "xml" || data ? r.responseXML : r.responseText;
// If the type is "script", eval it in global context
if (type == "script") jQuery.globalEval(data);
// Get the JavaScript object, if JSON is used.
if (type == "json") eval("data = " + data);
// evaluate scripts within html
if (type == "html") jQuery("<div>").html(data).evalScripts();
return data;
}
})
handleError was removed from jQuery in 1.5. Are you sure it's working in firefox etc.?
See: When was handleError removed from jQuery?

Resources