Javascript-форум (https://javascript.ru/forum/)
-   jQuery (https://javascript.ru/forum/jquery/)
-   -   Лажа со счетчиком (https://javascript.ru/forum/jquery/50907-lazha-so-schetchikom.html)

myshara 16.10.2014 16:05

Лажа со счетчиком
 
Привет ВСЕМ!

При подключении следующего кода на странице
<div class="cnt_block">
<!--LiveInternet counter--><script type="text/javascript"><!--
document.write("<a href='//www.liveinternet.ru/click' "+
"target=_blank><img src='//counter.yadro.ru/hit?t12.6;r"+
escape(document.referrer)+((typeof(screen)=="undefined")?"":
";s"+screen.width+"*"+screen.height+"*"+(screen.colorDepth?
screen.colorDepth:screen.pixelDepth))+";u"+escape(document.URL)+
";"+Math.random()+
"' alt='' title='LiveInternet: показано число просмотров за 24"+
" часа, посетителей за 24 часа и за сегодня' "+
"border='0' width='88' height='31'><\/a>")
//--></script><!--/LiveInternet-->
</div>


Получаем лажу:
Перестают открываться диалоговые окна.
т.е. $('#dialog').dialog('open') не срабатывает почему?
Если закоментить то все ОК.

В <head> имеем:
<script type="text/javascript" src="js/jquery-1.7.2.js"></script>
<script type="text/javascript" src="js/jquery-ui.js"></script>
<script type="text/javascript" src="js/jquery.form.js"></script>

krasovsky 17.10.2014 10:04

у тебя комментариями <!-- --> синтаксис нарушен.
//--></script><!--/LiveInternet--> - вот эт чо?
<!--document.write -или это?

danik.js 17.10.2014 10:28

Цитата:

Сообщение от krasovsky
//--></script><!--/LiveInternet--> - вот эт чо?

// - это JS комментарий, комментирует строку -->
</script> -закрывающий тег скрипта
<!--/LiveInternet--> - HTML-комментарий


Цитата:

Сообщение от krasovsky
<!--document.write -или это?

<!-- - это начало HTML комментария. JS-движок разпознает эту метку, если она в начале скрипта, и пропускает ее.

http://www.w3.org/TR/REC-html40/inte....html#h-18.3.2 :

Цитата:

Commenting scripts in JavaScript The JavaScript engine allows the string "<!--" to occur at the start of a SCRIPT element, and ignores further characters until the end of the line. JavaScript interprets "//" as starting a comment extending to the end of the current line. This is needed to hide the string "-->" from the JavaScript parser.


Часовой пояс GMT +3, время: 06:28.