Skip to content

Instantly share code, notes, and snippets.

@cou929
Created February 23, 2012 13:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cou929/1892784 to your computer and use it in GitHub Desktop.
Save cou929/1892784 to your computer and use it in GitHub Desktop.
function startSuccessfullGetTest() {
var output = document.getElementById('output');
if (!output) {
return;
}
function log(text) {
if (output && typeof output.innerHTML !== 'undefined') {
output.innerHTML = text;
} else {
document.write(text);
}
}
try {
if (tddjs.ajax && tddjs.ajax.get) {
var id = new Date().getTime();
tddjs.ajax.get('fragment.html?id=' + id, {
'success': function(xhr) {
log(xhr.responseText);
}
});
} else {
log('Browser does not support tddjs.ajax.get');
}
} catch (x) {
log('An exception occured: ' + x.message);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment