").html(data).evalScripts();
return data;
},
// Serialize an array of form elements or a set of
// key/values into a query string
param: function( a ) {
var s = [];
// If an array was passed in, assume that it is an array
// of form elements
if ( a.constructor == Array || a.jquery )
// Serialize the form elements
jQuery.each( a, function(){
alert("i'm encoding");
s.push( encodeURIComponent(this.name) + "=" + encodeURIComponent( this.value ) );
});
// Otherwise, assume that it's an object of key/value pairs
else
// Serialize the key/values
for ( var j in a )
// If the value is an array then the key names need to be repeated
if ( a[j] && a[j].constructor == Array )
jQuery.each( a[j], function(){
alert("i'm encoding again");
s.push( encodeURIComponent(j) + "=" + encodeURIComponent( this ) );
});
else {
//s.push( encodeURIComponent(j) + "=" + encodeURIComponent( a[j] ) );
s.push( j + "=" + a[j] );
//alert("i'm encoding another time");
}
// Return the resulting serialization
return s.join("&");
},
// evalulates a script in global context
// not reliable for safari
globalEval: function( data ) {
if ( window.execScript )
window.execScript( data );
else if ( jQuery.browser.safari )
// safari doesn't provide a synchronous global eval
window.setTimeout( data, 0 );
else
eval.call( window, data );
}
});
function transferActivityObject(newActivityObject){
activityObject = newActivityObject;
//activityObject = activityObject.replace(/\"/,"");
activityObject = activityObject.toString();
alert(activityObject);
}
function print_r(theObj){
//alert("inside print_r");
if(theObj.constructor == Array ||
theObj.constructor == Object){
("
")
for(var p in theObj){
if(theObj[p].constructor){
if(theObj[p].constructor == Array||
theObj[p].constructor == Object){
("- ["+p+"] => "+typeof(theObj)+"
");
("")
print_r(theObj[p]);
("
")
}
} else {
("- ["+p+"] => "+theObj[p]+"
");
alert(theObj[p]);
}
}
("
")
}
}
////////////////////////////////////////////////////////////////////////////
// Debugging (backend and UI)
////////////////////////////////////////////////////////////////////////////
/*
// Turn this on to get debug output.
const debugOutput = true;
function ddump(text)
{
if (debugOutput)
dump(text + "\n");
}
function ddumpCont(text)
{
if (debugOutput)
dump(text);
}
function ddumpObject(obj, name, maxDepth, curDepth)
{
if (!debugOutput)
return;
if (curDepth == undefined)
curDepth = 0;
if (maxDepth != undefined && curDepth > maxDepth)
return;
var i = 0;
for (prop in obj)
{
i++;
if (typeof(obj[prop]) == "object")
{
if (obj[prop] && obj[prop].length != undefined)
ddump(name + "." + prop + "=[probably array, length "
+ obj[prop].length + "]");
else
ddump(name + "." + prop + "=[" + typeof(obj[prop]) + "]");
ddumpObject(obj[prop], name + "." + prop, maxDepth, curDepth+1);
}
else if (typeof(obj[prop]) == "function")
ddump(name + "." + prop + "=[function]");
else
ddump(name + "." + prop + "=" + obj[prop]);
}
if (!i)
ddump(name + " is empty");
}
function dumpError(text)
{
dump(text + "\n");
}
*/