<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Ruben Sargsyan &#187; counter</title>
	<atom:link href="http://rubensargsyan.com/tag/counter/feed/" rel="self" type="application/rss+xml" />
	<link>http://rubensargsyan.com</link>
	<description>Personal Website</description>
	<lastBuildDate>Fri, 27 Aug 2010 07:08:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Count of all external links of the web page</title>
		<link>http://rubensargsyan.com/count-of-all-external-links-of-the-web-page/</link>
		<comments>http://rubensargsyan.com/count-of-all-external-links-of-the-web-page/#comments</comments>
		<pubDate>Tue, 24 Aug 2010 11:40:40 +0000</pubDate>
		<dc:creator>Ruben Sargsyan</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[counter]]></category>
		<category><![CDATA[external links]]></category>

		<guid isPermaLink="false">http://rubensargsyan.com/?p=402</guid>
		<description><![CDATA[This is a JavaScript script for counting all external links of the web page. Just add this script after the tag &#60;/body&#62;: &#60;script type=&#34;text/javascript&#34;&#62; var all_a = document.getElementsByTagName&#40;&#34;a&#34;&#41;; &#160; var this_link = window.location.toString&#40;&#41;; this_link = this_link.substr&#40;7,parseInt&#40;this_link.indexOf&#40;&#34;/&#34;,7&#41;-7&#41;&#41;; &#160; var external_links_count = 0; &#160; for&#40;var i=0; i&#60;all_a.length; i++&#41;&#123; if&#40;all_a&#91;i&#93;.href.indexOf&#40;this_link&#41;==-1&#41;&#123; external_links_count++; &#125; &#125; &#160; alert&#40;&#34;External links count is: [...]]]></description>
			<content:encoded><![CDATA[<p>This is a JavaScript script for counting all external links of the web page<span id="more-402"></span>. Just add this script after the tag &lt;/body&gt;:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>
<span style="color: #003366; font-weight: bold;">var</span> all_a <span style="color: #339933;">=</span> document.<span style="color: #660066;">getElementsByTagName</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;a&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">var</span> this_link <span style="color: #339933;">=</span> window.<span style="color: #660066;">location</span>.<span style="color: #660066;">toString</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
this_link <span style="color: #339933;">=</span> this_link.<span style="color: #660066;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">7</span><span style="color: #339933;">,</span>parseInt<span style="color: #009900;">&#40;</span>this_link.<span style="color: #660066;">indexOf</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;/&quot;</span><span style="color: #339933;">,</span><span style="color: #CC0000;">7</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-</span><span style="color: #CC0000;">7</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">var</span> external_links_count <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i<span style="color: #339933;">=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i<span style="color: #339933;">&lt;</span>all_a.<span style="color: #660066;">length</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>all_a<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">href</span>.<span style="color: #660066;">indexOf</span><span style="color: #009900;">&#40;</span>this_link<span style="color: #009900;">&#41;</span><span style="color: #339933;">==-</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        external_links_count<span style="color: #339933;">++;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;External links count is: &quot;</span><span style="color: #339933;">+</span>external_links_count<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://rubensargsyan.com/count-of-all-external-links-of-the-web-page/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Text counter by JavaScript</title>
		<link>http://rubensargsyan.com/text-counter-by-javascript/</link>
		<comments>http://rubensargsyan.com/text-counter-by-javascript/#comments</comments>
		<pubDate>Thu, 11 Feb 2010 10:36:47 +0000</pubDate>
		<dc:creator>Ruben Sargsyan</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[counter]]></category>
		<category><![CDATA[text]]></category>

		<guid isPermaLink="false">http://rubensargsyan.com/?p=270</guid>
		<description><![CDATA[This is an example for adding a counter to the inputing texts of tags &#60;textarea&#62; and &#60;input&#62;: &#60;html&#62; &#160; &#60;head&#62; &#60;title&#62;Text Counter&#60;/title&#62; &#160; &#60;script type=&#34;text/javascript&#34;&#62; function text_counter&#40;textfield_id,counter_id,count&#41;&#123; count = parseInt&#40;count&#41;; &#160; document.getElementById&#40;counter_id&#41;.innerHTML = count; &#160; document.getElementById&#40;textfield_id&#41;.onpropertychange = function&#40;&#41;&#123; text_count_changed&#40;textfield_id,counter_id,count&#41;; &#125; &#125; &#160; function text_count_changed&#40;textfield_id,counter_id,count&#41;&#123; if&#40;count-parseInt&#40;document.getElementById&#40;textfield_id&#41;.value.length&#41;&#60;0&#41;&#123; document.getElementById&#40;textfield_id&#41;.value = document.getElementById&#40;textfield_id&#41;.value.substr&#40;0,count&#41;; &#125; &#160; document.getElementById&#40;counter_id&#41;.innerHTML = count-parseInt&#40;document.getElementById&#40;textfield_id&#41;.value.length&#41;; &#125; &#60;/script&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>This is an example for adding a counter to the inputing texts of tags &lt;textarea&gt; and &lt;input&gt;:<span id="more-270"></span></p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">&lt;html&gt;
&nbsp;
&lt;head&gt;
  &lt;title&gt;Text Counter&lt;/title&gt;
&nbsp;
  <span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>
  <span style="color: #003366; font-weight: bold;">function</span> text_counter<span style="color: #009900;">&#40;</span>textfield_id<span style="color: #339933;">,</span>counter_id<span style="color: #339933;">,</span>count<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    count <span style="color: #339933;">=</span> parseInt<span style="color: #009900;">&#40;</span>count<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span>counter_id<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">innerHTML</span> <span style="color: #339933;">=</span> count<span style="color: #339933;">;</span>
&nbsp;
    document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span>textfield_id<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">onpropertychange</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        text_count_changed<span style="color: #009900;">&#40;</span>textfield_id<span style="color: #339933;">,</span>counter_id<span style="color: #339933;">,</span>count<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #003366; font-weight: bold;">function</span> text_count_changed<span style="color: #009900;">&#40;</span>textfield_id<span style="color: #339933;">,</span>counter_id<span style="color: #339933;">,</span>count<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>count<span style="color: #339933;">-</span>parseInt<span style="color: #009900;">&#40;</span>document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span>textfield_id<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">value</span>.<span style="color: #660066;">length</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">&lt;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span>textfield_id<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">value</span> <span style="color: #339933;">=</span> document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span>textfield_id<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">value</span>.<span style="color: #660066;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">,</span>count<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span>counter_id<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">innerHTML</span> <span style="color: #339933;">=</span> count<span style="color: #339933;">-</span>parseInt<span style="color: #009900;">&#40;</span>document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span>textfield_id<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">value</span>.<span style="color: #660066;">length</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
  <span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span>
&lt;/head&gt;
&nbsp;
&lt;body&gt;
&lt;p&gt;
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>inputtext_approving_chars_count <span style="color: #339933;">=</span> <span style="color: #CC0000;">10</span><span style="color: #339933;">;&lt;/</span>script<span style="color: #339933;">&gt;</span>
&lt;input type=&quot;text&quot; id=&quot;inputtext&quot; oninput='text_count_changed(&quot;inputtext&quot;,&quot;inputtext_counter&quot;,inputtext_approving_chars_count);'&gt; &lt;span id=&quot;inputtext_counter&quot;&gt;&lt;/span&gt;
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>text_counter<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;inputtext&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;inputtext_counter&quot;</span><span style="color: #339933;">,</span>inputtext_approving_chars_count<span style="color: #009900;">&#41;</span><span style="color: #339933;">;&lt;/</span>script<span style="color: #339933;">&gt;</span>
&lt;/p&gt;
&nbsp;
&lt;p&gt;
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>textfield_approving_chars_count <span style="color: #339933;">=</span> <span style="color: #CC0000;">255</span><span style="color: #339933;">;&lt;/</span>script<span style="color: #339933;">&gt;</span>
&lt;textarea id=&quot;textfield&quot; cols=&quot;50&quot; rows=&quot;10&quot; oninput='text_count_changed(&quot;textfield&quot;,&quot;textfield_counter&quot;,textfield_approving_chars_count);'&gt;&lt;/textarea&gt; &lt;span id=&quot;textfield_counter&quot;&gt;&lt;/span&gt;
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>text_counter<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;textfield&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;textfield_counter&quot;</span><span style="color: #339933;">,</span>textfield_approving_chars_count<span style="color: #009900;">&#41;</span><span style="color: #339933;">;&lt;/</span>script<span style="color: #339933;">&gt;</span>
&lt;/p&gt;
&nbsp;
&lt;/body&gt;
&nbsp;
&lt;/html&gt;</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://rubensargsyan.com/text-counter-by-javascript/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
