DLE, JavaScript и Opera...

S
На сайте с 17.12.2011
Offline
0
550

Привет! Нужна помощь в решении проблемы.

Под потребности помогли написать скрипт, чтобы статические страницы, на которые есть ссылки в новостях (посредством дополнительных полей), выводились в мода(у)льном окне.

Тестировал на FireFox и Chrome - все отлично работало. Потом решил проверить на Opera... Итог - выдается сообщение "Подождите, идет загрузка" и тут же пропадает. Больше никаких изменений.

Через консоль ошибок получил ошибки, но как починить - не соображу. И тот, кто писал не может сообразить. Ниже приведу скрипт (вставлен в начало шаблона краткой новости) и ошибки. Надеюсь на помощь знатоков). Спасибо.

Скрипт:

<script type="text/javascript">

function Showstaticpage[xfgiven_static][xfvalue_static][/xfgiven_static]( r ) {
$("#staticpage[xfgiven_static][xfvalue_static][/xfgiven_static]").remove();
$("body").append(r);
$('#staticpage[xfgiven_static][xfvalue_static][/xfgiven_static]').dialog({
modal:!0,autoOpen: true,
show: 'fade',
hide: 'fade',
width: 800,
height: 500,
overflow: 'scroll',
buttons: {
"Закрыть" : function() {
$(this).dialog("close");
}
}
}); return false;
};

function staticpage[xfgiven_static][xfvalue_static][/xfgiven_static]( pages ) {
if (document.getElementById('staticpage[xfgiven_static][xfvalue_static][/xfgiven_static]')) {
$('#staticpage[xfgiven_static][xfvalue_static][/xfgiven_static]').dialog('open');return false;
}
ShowLoading('');
$.get(dle_root + "engine/ajax/staticpage.php", {
pages: pages, skin: dle_skin,
},
function(data) {
HideLoading('');
Showstaticpage[xfgiven_static][xfvalue_static][/xfgiven_static]( data );
});return false;
};
</script>

Ошибки из консоли Оперы:

Unknown thread
Uncaught exception: DOMException: HIERARCHY_REQUEST_ERR
Error thrown at line 18, column 1726 in <anonymous function: clean>(a, b, d, e) in http://localhost/engine/classes/js/jquery.js:
j++
called from line 17, column 63980 in <anonymous function: f.buildFragment>(a, b, d) in http://localhost/engine/classes/js/jquery.js:
b&&b[0]&&(i=b[0].ownerDocument||b[0]),i.createDocumentFragment||(i=c),a.length===1&&typeof a[0]=="string"&&a[0].length<512&&i===c&&a[0].charAt(0)==="<"&&!bb.test(a[0])&&(f.support.checkClone||!bc.test(a[0]))&&(g=!0,h=f.fragments[a[0]],h&&h!==1&&(e=h)),e||(e=i.createDocumentFragment(),f.clean(a,i,e,d)),g&&(f.fragments[a[0]]=h?e:1);
called from line 17, column 62843 in <anonymous function: domManip>(a, c, d) in http://localhost/engine/classes/js/jquery.js:
i=j&&j.parentNode,f.support.parentNode&&i&&i.nodeType===11&&i.childNodes.length===this.length?e={fragment:i}:e=f.buildFragment(a,this,k),h=e.fragment,h.childNodes.length===1?g=h=h.firstChild:g=h.firstChild;
called from line 17, column 58083 in <anonymous function: append>() in http://localhost/engine/classes/js/jquery.js:
return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})
called from line 5, column 1 in Showstaticpageyandex(r) in http://localhost/:
$("body").append(r);
called from line 31, column 2 in <anonymous function>(data) in http://localhost/:
Showstaticpageyandex( data );
called via Function.prototype.apply() from line 16, column 30908 in <anonymous function: resolveWith>(e, f) in http://localhost/engine/classes/js/jquery.js:
a.shift().apply(e,f)
called from line 18, column 16436 in w(a, c, l, m) in http://localhost/engine/classes/js/jquery.js:
v.status=a,v.statusText=c,o?h.resolveWith(e,[r,c,v]):h.rejectWith(e,[v,c,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.resolveWith(e,[v,c]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))
called from line 18, column 28099 in <anonymous function: d>(a, e) in http://localhost/engine/classes/js/jquery.js:
m&&g(j,k,m,l)
called from unknown location in program code:
/* no source available */

Авторизуйтесь или зарегистрируйтесь, чтобы оставить комментарий