Created
October 12, 2011 18:15
-
-
Save dmolsen/1282062 to your computer and use it in GitHub Desktop.
simple test of an ajax success function
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.ajax({ | |
url: "test.html", | |
dataType: 'xml', | |
success: function (data) { | |
$('#cancelPayment',data).attr('bar','element'); | |
var str = (new XMLSerializer()).serializeToString(data); | |
$('#appDiv').html(str).trigger('create'); | |
} | |
}); |
Because I have no control over what the Java Developer is giving me (i.e.broken html), I ended up with a different solution:
$.ajax({
type: "POST",
url: url,
data: paymentStr,
success: function(data) {
var dataStorage = $(bpm.remoteAppDivName).html(data);
$('#cancelPayment').attr('data-theme','d')
dataStorage.trigger('create');
}
});
Though I would share this with you. Thanx again!
nice. thanks :)
On Fri, Oct 14, 2011 at 10:21 AM, Elizeo Benavidez ***@***.*** wrote:
Because I have no control over what the Java Developer is giving me (i.e.broken html), I ended up with a different solution:
$.ajax({
type: "POST",
url: url,
data: paymentStr,
success: function(data) {
var dataStorage = $(bpm.remoteAppDivName).html(data);
$('#cancelPayment').attr('data-theme','d')
dataStorage.trigger('create');
}
});
Though I would share this with you. Thanx again!
##
Reply to this email directly or view it on GitHub:
https://gist.github.com/1282062
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
So it turns out that using the 'xml' feature, the return data(html) has to be clean with proper closing tags and whatnot. Once I more properly formatted the html, it works! Huge thanx for your help. To some it might not seem like such a big deal to de-emphasize the cancel button, but to me it's huge and it makes a clearer path to completion, give the user a better UX and increases conversion.