【发布时间】:2014-03-21 13:16:35
【问题描述】:
我得到的输出看起来像这样
" object 对象不再可用,已从 assignment#257" 中删除
使用以下代码
if(typeof find_staff.staff != 'undefined') {
var staff = find_staff.staff;
staff = $.extend({}, staff.preferences, staff.staff);
if(typeof(staff[staff_id]) != 'undefined') {
loop_continue = true;
}
else {
$('#' + i).html('<p>' + staff + ' is no longer available and has been removed from assignment #' + booking_id + '</p>');
// Break from loop
loop_continue = false;
}
}
else {
$('#' + i).html('<p>' + staff + ' is no longer available and has been removed from #' + v.booking_id + '</p>');
// Break from loop
loop_continue = false;
}
【问题讨论】:
-
对于大多数对象,
'' + ({}) + ''; // "[object Object]"
标签: javascript php error-handling