function paintOrders(DivId) {
var container = '<div>';
$.each(DivId, function () {
container += 'TXT' + '<br/><br/>';
});
container += '</div>';
$('#div_' + DivId).append(container);
}
ShipmentNum is unique id
the divs that I need to append the text into them are in another div and another div:
<div id="leftGrid" style="position: relative;float:left;width:50%;">
<div>
<div id="div_11626">11626----</div>
<br>
<div id="div_12109">12109----0</div>
<br>
<div id="div_13089">13089----</div>
<br>
</div>
</div>
$('#div_' + items).append(container);
ERROR uncaught exception: Syntax error, unrecognized expression:
[object Object]
Calling function:
function paintShipments(items) {
var div = $('<div/>');
$.each(items, function () {
var shipment = this.Shipment;
$('<div id="div_' + this.Shipment + '">' + this.Shipment + '----' + this.DriverNames + '---' + this.Kavs + '</div>').click(function () {
_Services.invoke({
method: 'GetOrdersGrid',
data: { ShipmentNumber: shipment },
success: function (shipment) {
paintOrders(shipment);
}
});
}).appendTo(div);
$('<br/>').appendTo(div);
});
$("#leftGrid").append(div);
}
I don’t see any error.
http://jsbin.com/ugojiy/3/edit
What’s your jQuery version?
Is there any other Javascript code error that it is interfering?