How can I manipulate html received from the server with get()?
var jqxhr = $.get("/ajax/get_info", function(data) {
// here I want to change the data
$.colorbox({html:function(){
return data;
}});
});
When using Jquery selectors it ignores the html data received, unless I append it to the DOM first.
I want to change the data before passing it to Colorbox. How can I do that?
As you say, just… change the data before you pass it to colorbox:
If you want to perform DOM manipulations on an arbitrary HTML string: