I went with dynamic code instead. Unlike on the server side, it’s a very bad idea to load tons of javascript classes into a browser. I did something to this effect:
var someSQLObj = Class.create();
someSQLObj.prototype = {
objName : ’someSQLobject’,
errMsg : ‘Object could not be loaded’,
errMsgUpdate : ‘Could not update’,
data : null,
initialize: function(id){
var err = this.errMsg;
this.objName = id;
new Ajax.Request(’/autoclassajax.php?action=getObject&SQLObj=’ + this.objName,
{
method:’get’,
onSuccess: function(transport){
var response = transport.responseJSON || err;
this.loadData(response);
},
onFailure: function(){ alert(err); }
});
},
loadData : function(data){
this.data = data;
// if the HTTP request is good, it should be the SQL object as a JS object
alert(this.data);
},
getParam(param) {
var prm = ”;
eval(’prm = this.data.’ + param + ‘;’);
return prm;
},
setParam(param) {
eval(’this.data.’ + param + ‘ = prm;’);
},
save: function() {
var err = this.errMsgUpdate;
new Ajax.Request(’/autoclassajax.php?action=setObject&SQLObj=’ + this.objName + ‘&jsonData=’ + escape(Object.toJSON(this.data)),
{
method:’get’,
onSuccess: function(transport){
var response = transport.responseText || “no response text”;
#alert(”Success!
” + response);
},
onFailure: function(){ alert(err); }
});
},
};
Roughly anyway. At any rate, I have reduced the SQL generator robot to only generate PHP classes and connector bindings, then I am loading the objects into JS dynamically, and producing the client side div.innerHTML code on the fly. The less Javascript code the better. It’s a performance issue.
Related Stuff
-
MooV: Using cutting edge Video phones and Software Video Phones - coupling all that with VoIP and empowering the disabled.
-
Moo Telecom: VoIP communications made easy - Ring anyway with the fun and ease of using a normal phone
-
TagR:Mobile Social Network with Real Time Locations Based services, and Ambience Intelligence, VoiP, IM, Skype, Googletalk, Mapping, Flickr, Events, Calendaring, Scheduling, SecondLife Support
-
ClearSMS : ClearSMS is a Web-based application that lets you send bulk SMS messages to your customers, contacts, or just about anyone.
-
Jajah:jah is a VoIP (Voice over IP) provider, founded by Austrians Roman Scharf and Daniel Mattes in 2005[1]. The Jajah headquarters are located in Mountain View, CA, USA, and Luxembourg. Jajah maintains a development centre in Israel.
-
Skype: It’s free to download and free to call other people on Skype. Skype the number one voice over ip software
- PrivatePhone: a free local phone number with voicemail and messages you can check online or from any phone.
Be the first ... |Add your comment.
Your Comment ...
Name (required)
Email (required, hidden)
Website
