Reputation: 3465
I want to know how I need to write the line $j('#'+divRes).html()=datos;
in order to work properly in a jquery-protype environment. I obtain the error: invalid assignment left-hand side
function tx_oriconvocatorias_formPost_init(divRes) {
var $j = jQuery.noConflict();
$j.ajax({
type: 'GET',
data: 'eID=ori_convocatorias_formPost',
success: function(datos){
$j('#'+divRes).html()=datos;
},
});
}
Thanks in advance.
Upvotes: 1
Views: 458
Reputation: 13853
To set the html using jQuery the command is,
$j('#'+divRes).html(datos);
.html() returns the current html, which you are trying to set, which causes the error
Upvotes: 2
Reputation: 78690
This has nothing to do with prototype, you can't assign to that. You want to do this:
$j('#'+divRes).html(datos);
Upvotes: 2
Reputation: 76228
Simply change it to $j('#'+divRes).html(datos);
In jQuery, to read the html, use var str = $('#id').html()
and to assign, .html('[html string]')
Upvotes: 3