<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1043410" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1043410</link>
    <description></description>
    <language>en</language>
          <item>
    <title>I think you need to look at</title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/why-does-my-javascript-function-not-work#comment-1239983</link>
    <description> &lt;p&gt;I think you need to look at your brackets again....i don&#039;t think that the sequence of brackets is right..Looping is seen to me there..May be i am wrong but please take a note of that too...and do tell me if that works for you...&lt;/p&gt;
 </description>
     <pubDate>Wed, 01 Apr 2009 12:56:22 +0000</pubDate>
 <dc:creator>coolman009</dc:creator>
 <guid isPermaLink="false">comment 1239983 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>I don&#039;t think you use square</title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/why-does-my-javascript-function-not-work#comment-1239773</link>
    <description> &lt;p&gt;I don&#039;t think you use square brackets for the array definition (only for individual elements arrayname[0])&lt;/p&gt;
&lt;p&gt;try&lt;/p&gt;
&lt;p&gt;&lt;code&gt;headings = (&amp;quot;h1&amp;quot;,&amp;quot;h2&amp;quot;,&amp;quot;h3&amp;quot;);&lt;/code&gt;&lt;/p&gt;
 </description>
     <pubDate>Wed, 25 Mar 2009 12:21:24 +0000</pubDate>
 <dc:creator>decibel.places</dc:creator>
 <guid isPermaLink="false">comment 1239773 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>Can you post the entire</title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/why-does-my-javascript-function-not-work#comment-1239755</link>
    <description> &lt;p&gt;Can you post the entire javascript source code? It would make it a lot simpler to debug.&lt;/p&gt;
 </description>
     <pubDate>Tue, 24 Mar 2009 21:00:46 +0000</pubDate>
 <dc:creator>teammatt3</dc:creator>
 <guid isPermaLink="false">comment 1239755 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>for some reason the problem</title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/why-does-my-javascript-function-not-work#comment-1239754</link>
    <description> &lt;p&gt;for some reason the problem seems to be accessing the array from within a function.&lt;br /&gt;
I declared the array at the top of the page as you mentioned above and then defined some data to it like this:&lt;/p&gt;
&lt;p&gt;var headings = new Array(&quot;h1&quot;,&quot;h2&quot;,&quot;h3&quot;);&lt;/p&gt;
&lt;p&gt;that is ok, no error. But if i try and access the array from within a function the error console is telling me it is not defined. &lt;/p&gt;
&lt;p&gt;Do i have to declare an array locally and not use it globally?&lt;/p&gt;
 </description>
     <pubDate>Tue, 24 Mar 2009 18:56:21 +0000</pubDate>
 <dc:creator>benf</dc:creator>
 <guid isPermaLink="false">comment 1239754 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>try
var headings = new</title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/why-does-my-javascript-function-not-work#comment-1239705</link>
    <description> &lt;p&gt;try&lt;/p&gt;
&lt;p&gt;&lt;code&gt;var headings = new Array();&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;(capital &quot;A&quot;)&lt;/p&gt;
 </description>
     <pubDate>Mon, 23 Mar 2009 19:45:12 +0000</pubDate>
 <dc:creator>decibel.places</dc:creator>
 <guid isPermaLink="false">comment 1239705 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>Yes you were correct i</title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/why-does-my-javascript-function-not-work#comment-1239682</link>
    <description> &lt;p&gt;Yes you were correct i missed that it should be &lt;/p&gt;
&lt;p&gt;if(findHeading.indexOf(headings[h]) != -1)&lt;/p&gt;
&lt;p&gt;and findHeading was defined as the innerHTML of an element: so i changed this to just the reference to the element id.&lt;/p&gt;
&lt;p&gt;Thats all fine, but where i have declared the headings array at the top of the page&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;var headings = new array()&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;i now get a error message from error console saying the below:&lt;/p&gt;
&lt;p&gt;Error: array is not defined&lt;br /&gt;
Source File:&lt;br /&gt;
Line: 20&lt;/p&gt;
 </description>
     <pubDate>Mon, 23 Mar 2009 18:09:59 +0000</pubDate>
 <dc:creator>benf</dc:creator>
 <guid isPermaLink="false">comment 1239682 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>Can you post some of your</title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/why-does-my-javascript-function-not-work#comment-1239667</link>
    <description> &lt;p&gt;Can you post some of your HTML code?&lt;/p&gt;
&lt;p&gt;This statement looks a little odd too:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;if(findHeading.indexOf(headings[h] != -1))&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;should probably be &lt;/p&gt;
&lt;p&gt;&lt;code&gt;if(findHeading.indexOf(headings[h]) != -1)&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;but I sometimes have fewer problems with &lt;/p&gt;
&lt;p&gt;&lt;code&gt;if(findHeading.indexOf(headings[h])+1 != 0)&lt;/code&gt;&lt;/p&gt;
 </description>
     <pubDate>Mon, 23 Mar 2009 16:06:12 +0000</pubDate>
 <dc:creator>decibel.places</dc:creator>
 <guid isPermaLink="false">comment 1239667 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>Where is findHeading</title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/why-does-my-javascript-function-not-work#comment-1239665</link>
    <description> &lt;p&gt;Where is findHeading defined?&lt;/p&gt;
&lt;p&gt;This statement looks a little odd too:&lt;/p&gt;
&lt;p&gt;if(findHeading.indexOf&lt;strong&gt;(headings[h] != -1)&lt;/strong&gt;){&lt;/p&gt;
&lt;p&gt;Why is a comparison operator in the indexOf Method?&lt;/p&gt;
 </description>
     <pubDate>Mon, 23 Mar 2009 15:26:07 +0000</pubDate>
 <dc:creator>teammatt3</dc:creator>
 <guid isPermaLink="false">comment 1239665 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
