if(type == 'ajax') {
var dataType = pio.content.dataType || 'html';
$.ajax({
url: pio.content.url,
dataType: dataType,
beforeSend: function() {
$(ct).html('Loading...');
},
success: function(data, textStatus, jqXHR) {
if(dataType == 'html') {
content = data;
$(ct).html(data);
} else if(dataType == 'json') {
if($.isFunction(pio.content.formatter)) {
content = pio.content.formatter(o, pio, data);
$(ct).html(content);
}
}
_callAfterShow(content);
if($.isFunction(cl)) {
cl.call(that, data);
}
},
error: function(jqXHR, textStatus, errorThrown) {
var content = "<span style='padding:0.2em' class='ui-state-error ui-corner-all'>Load Error...</span>";
$(ct).html(content);
if ($.isFunction(pio.content.error)) {
pio.content.error.call(ct, jqXHR, textStatus, errorThrown);
}
}
});
)
var dataType = pio.content.dataType || 'html';
$.ajax({
url: pio.content.url,
dataType: dataType,
beforeSend: function() {
$(ct).html('Loading...');
},
success: function(data, textStatus, jqXHR) {
if(dataType == 'html') {
content = data;
$(ct).html(data);
} else if(dataType == 'json') {
if($.isFunction(pio.content.formatter)) {
content = pio.content.formatter(o, pio, data);
$(ct).html(content);
}
}
_callAfterShow(content);
if($.isFunction(cl)) {
cl.call(that, data);
}
},
error: function(jqXHR, textStatus, errorThrown) {
var content = "<span style='padding:0.2em' class='ui-state-error ui-corner-all'>Load Error...</span>";
$(ct).html(content);
if ($.isFunction(pio.content.error)) {
pio.content.error.call(ct, jqXHR, textStatus, errorThrown);
}
}
});
)