<?xml version='1.0' encoding="utf-8"?>
      <rss version='2.0'>
      <channel>
      <title>Форум на Исходниках.RU</title>
      <link>https://forum.sources.ru</link>
      <description>Форум на Исходниках.RU</description>
      <generator>Форум на Исходниках.RU</generator>
  	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=411186&amp;view=findpost&amp;p=3736339</guid>
        <pubDate>Fri, 11 Aug 2017 16:52:24 +0000</pubDate>
        <title>Отключить обработку ссылок внутри jQuery dialog</title>
        <link>https://forum.sources.ru/index.php?showtopic=411186&amp;view=findpost&amp;p=3736339</link>
        <description><![CDATA[DIS: Смысл такой. В диалоге jQuery открывается чат. В некоторых сообщениях содержатся ссылки вида:<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">&#60;a href=&quot;/order/view/3690&quot; data-popup=&quot;window&quot; data-window-name=&quot;order_edit_3690&quot;&#62;#3690&#60;/a&#62;</div></ol></div></div></div></div><script>preloadCodeButtons('1');</script><br>
На них навешан обработчик:<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">&nbsp;&nbsp; &nbsp;$(&quot;body&quot;).on(&#39;click&#39;, &#39;a[data-popup]&#39;, function (e) {</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;e.preventDefault();</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;var link = $(this);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;var target = $(this).attr(&quot;data-popup&quot;);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;var window_name = $(this).attr(&quot;data-window-name&quot;);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;if(target==&quot;window&quot;) {</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;openWindow(link.attr(&quot;href&quot;), window_name);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;} else if(target==&quot;parent&quot;) {</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;openParentWindow(link.attr(&quot;href&quot;), window_name);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;} else if(target==&quot;this&quot;) {</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;window.location = link.attr(&quot;href&quot;);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;} else {</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;window.open(link.attr(&quot;href&quot;), &quot;&quot;);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;return false;</div><div class="code_line">&nbsp;&nbsp; &nbsp;});</div></ol></div></div></div></div><br>
<br>
При клике на ссылку окно открывается. Но вместе с этим все содержимое страницы по ссылке загружается в контейнер диалога и получается фигня. Пробую воспроизвести на jsFiddle - все работает как надо. Причем есть ссылки, которые переключают чаты, которые тоже содержат урл и обработчики и отрабатывают корректно.]]></description>
        <author>DIS</author>
        <category>JavaScript, DOM/DHTML</category>
      </item>
	
      </channel>
      </rss>
	