Rolf, I fixed the hardcoding:
asyncReq: function(partName, callback) {
var purl = this.partsUrl + partName;
purl = purl.replace(/\\/gi, "/");
this.asyncnum++;
new Ajax.Request(purl, {
method: 'get',
onSuccess: (function(transport) {
var res = transport.responseText;
this.asyncnum--;
callback(res);
}).bind(this),
onFailure: (function() {
purl = this.partsUrl + /p/ + partName;
new Ajax.Request(purl, {
method: 'get',
onSuccess: (function(transport) {
var res = transport.responseText;
this.asyncnum--;
callback(res);
}).bind(this),
onFailure: (function() {
this.asyncnum--;
alert('Something went wrong loading: ' + purl);
}).bind(this)
});
}).bind(this)
});
},
asyncReq: function(partName, callback) {
var purl = this.partsUrl + partName;
purl = purl.replace(/\\/gi, "/");
this.asyncnum++;
new Ajax.Request(purl, {
method: 'get',
onSuccess: (function(transport) {
var res = transport.responseText;
this.asyncnum--;
callback(res);
}).bind(this),
onFailure: (function() {
purl = this.partsUrl + /p/ + partName;
new Ajax.Request(purl, {
method: 'get',
onSuccess: (function(transport) {
var res = transport.responseText;
this.asyncnum--;
callback(res);
}).bind(this),
onFailure: (function() {
this.asyncnum--;
alert('Something went wrong loading: ' + purl);
}).bind(this)
});
}).bind(this)
});
},
Industrial Design, Linux, Lego.