<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; JS: Не обрабатывает код в var]]></title>
		<link>http://forum.script-coding.com/viewtopic.php?id=11121</link>
		<atom:link href="http://forum.script-coding.com/extern.php?action=feed&amp;tid=11121&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «JS: Не обрабатывает код в var».]]></description>
		<lastBuildDate>Mon, 07 Dec 2015 05:06:18 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: JS: Не обрабатывает код в var]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=99563#p99563</link>
			<description><![CDATA[<p><strong>Spy00000</strong>, спасибо!</p>]]></description>
			<author><![CDATA[null@example.com (MrSkrask)]]></author>
			<pubDate>Mon, 07 Dec 2015 05:06:18 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=99563#p99563</guid>
		</item>
		<item>
			<title><![CDATA[Re: JS: Не обрабатывает код в var]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=99503#p99503</link>
			<description><![CDATA[<p><strong>MrSkrask</strong><br />Попробуйте написать код так, как показано ниже:<br /></p><div class="codebox"><pre><code>var phoneBook=[
{&#039;cn&#039;:&#039;page&#039;,&#039;telephoneNumber&#039;:&#039;test&#039;,&#039;mobile&#039;:&#039;test&#039;,&#039;title&#039;:&#039;test&#039;,&#039;department&#039;:&#039;test&#039;},
{&#039;cn&#039;:&#039;&lt;div&gt;&lt;a href=&quot;javascript:collapsElement(\&#039;identifikator\&#039;)&quot; title=&quot;&quot; rel=&quot;nofollow&quot;&gt;page&lt;/a&gt;&lt;div id=&quot;identifikator&quot; style=&quot;display: none&quot;&gt;&lt;p&gt;Текст&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&#039;,&#039;telephoneNumber&#039;:&#039;test&#039;,&#039;mobile&#039;:&#039;test&#039;,&#039;title&#039;:&#039;test&#039;,&#039;department&#039;:&#039;test&#039;}]</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Spy00000)]]></author>
			<pubDate>Thu, 03 Dec 2015 14:54:37 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=99503#p99503</guid>
		</item>
		<item>
			<title><![CDATA[JS: Не обрабатывает код в var]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=99487#p99487</link>
			<description><![CDATA[<p>При написании скрипта столкнулся с такой проблемой,<br />при клику по ссылке снизу должен выпасть текст, - собственно с этим проблем нет:<br /></p><div class="codebox"><pre><code>&lt;script&gt;
 function collapsElement(id) {
 if ( document.getElementById(id).style.display != &quot;none&quot; ) {
 document.getElementById(id).style.display = &#039;none&#039;;
 }
 else {
 document.getElementById(id).style.display = &#039;&#039;;
 }
 }
 &lt;/script&gt;
&lt;div&gt;&lt;a href=&quot;javascript:collapsElement(&#039;identifikator&#039;)&quot; title=&quot;&quot; rel=&quot;nofollow&quot;&gt;page&lt;/a&gt;
&lt;div id=&quot;identifikator&quot; style=&quot;display: none&quot;&gt;
&lt;p&gt;text&lt;/p&gt;
&lt;/div&gt;
</code></pre></div><p>Проблема в том что я не могу понять как адаптировать(применить) данный код к:<br /></p><div class="codebox"><pre><code>
&lt;script type=&#039;text/javascript&#039;&gt;
var phoneBook=[
{&#039;cn&#039;:&#039;page&#039;,&#039;telephoneNumber&#039;:&#039;test&#039;,&#039;mobile&#039;:&#039;test&#039;,&#039;title&#039;:&#039;test&#039;,&#039;department&#039;:&#039;test&#039;},
{&#039;cn&#039;:&#039;&lt;div&gt;&lt;a href=&quot;javascript:collapsElement(&#039;identifikator&#039;)&quot; title=&quot;&quot; rel=&quot;nofollow&quot;&gt;page&lt;/a&gt;&lt;div id=&quot;identifikator&quot; style=&quot;display: none&quot;&gt;&lt;p&gt;Текст&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&#039;,&#039;telephoneNumber&#039;:&#039;test&#039;,&#039;mobile&#039;:&#039;test&#039;,&#039;title&#039;:&#039;test&#039;,&#039;department&#039;:&#039;test&#039;}]
...</code></pre></div><p>Если убрать этот кусок естественно все работает,<br /></p><div class="codebox"><pre><code>javascript:collapsElement(&#039;identifikator&#039;) </code></pre></div><p>но нужно чтобы снизу выпадал текст.<br />Как быть в этой ситуации?<br />P.S. Весь код в приложении.</p>]]></description>
			<author><![CDATA[null@example.com (MrSkrask)]]></author>
			<pubDate>Thu, 03 Dec 2015 06:50:05 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=99487#p99487</guid>
		</item>
	</channel>
</rss>
