Динамическое создание таблиц в jQuery
м строит некоторые данные динамически с помощью jQuery, но яя получаю следующую ошибку:
Uncaught Error: HIERARCHY_REQUEST_ERR: DOM Exception 3
Это происходит в приложении к части скрипта, которая выглядит следующим образом:
$('').append(
/* lots of stuff */
).add(
$('')
).append(
/* some more */
).appendTo($tbody);
куда$tbody
является$('');
Кто-нибудь может мне помочь, пожалуйста? Для полноты, это весь код:
$('#visitsContainer').show();
$div = $('').css('margin-top', '7px').css('width', '620px').addClass('groupBox');
$table = $('').attr('cellpadding', '3').attr('cellspacing', '0').attr('width', '620');
$tbody = $('');
$('').append(
$('').css('width', '45px').attr('valign', 'top').attr('rowspan', '3').attr('align', 'center').append(
$('<a>').attr('href', '/sparkx/' + userData.username).append(
$('<img>').attr('src', '/media/profile/40px/' + userData.photo).attr('alt', userData.firstname).attr('border', '1').css('border-color', '#c0c0c0').css('max-width', ' 42px').css('max-height', ' 40px')
)
).add(
$('').css('border-bottom', '1px dotted #D21C5B').css('border-right', '1px dotted #D21C5B').css('width', '200px').append(
$('</a><a>').attr('href', '/sparkx/' + userData.username).append(
$('<strong>').text(userData.fullname)
).add(
$('<br>')
).add(
userData.city)
)
).add(
$('').css('border-bottom', '1px dotted #D21C5B').css('width', '110px').append(
$('</strong></a><strong><a>').attr('href', '/profile/' + userData.username + '/sendpm').css('line-height', '18px').append(
$('<img>').attr('src', '/templates/front/default/images/send_new_icon.gif').attr('alt', 'Stuur bericht').attr('border', '0').attr('align', 'left').css('margin-right', '5px')
).append(
'Stuur bericht')
)
).add(
$('').css('border-bottom', '1px dotted #D21C5B').css('width', '170px').append(
$('').text(
'Geplaatst op:')
).append(
' ' + posted
)
).add(
$('').css('border-bottom', '1px dotted #D21C5B').css('width', '135px').append(
(month > 0 ?
$('').text('Was hier:')
:
$('').css('width', '1px').html(' ')
)).append(month > 0 ? ' ' + months[month] + ' ' + year : '')
)
).add(
(rating > 0 ?
$('').append(
$('').attr('colspan', '4').append(
$('<strong>').css('color', '#D21C5B').text(userData.firstname + ' vond dit ').append(
(rating == 3 ?
$('').text('een aanrader ').add(
$('<img>').attr('src', '/templates/front/default/images/thumbGood.png').attr('alt', 'Goed').attr('height', '16').css('margin-left', '3px')
)
: (rating == 2 ?
$('').text('een aanrader ').add(
$('<img>').attr('src', '/templates/front/default/images/thumbAvg.png').attr('alt', 'Redelijk').attr('height', '16').css('margin-left', '3px')
)
:
$('').text('slecht ').add(
$('<img>').attr('src', '/templates/front/default/images/thumbBad.png').attr('alt', 'Slecht').attr('height', '16').css('margin-left', '3px')
)
))
)
)
)
: '')
).add(
(content ?
$('').append(
$('').attr('colspan', '4').append(
$('').css('width', '100%').text(content).add(
$('').css('float', 'right').css('clear', 'both').append(
$('</strong></a><strong><a>').attr('href', '/guide/editreaction/' + id).append(
$('').text('edit')
).add(
$('</a><a>').attr('href', thisURL + '/rr/' + id).css('padding-left', '10px').append(
$('').text('delete')
))
))
)
)
: '')
).appendTo($tbody);
$tbody.appendTo($table);
$table.appendTo($div);
$div.prependTo($('#visits'));
</a></strong></strong>