<?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>Open Source Web &#187; dynamic</title>
	<atom:link href="http://www.open-source-web.com/tag/dynamic/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.open-source-web.com</link>
	<description>Your open source for Development and Design</description>
	<lastBuildDate>Sun, 08 Jan 2012 10:21:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Javascript get element by id</title>
		<link>http://www.open-source-web.com/javascript/javascript-get-element-by-id/</link>
		<comments>http://www.open-source-web.com/javascript/javascript-get-element-by-id/#comments</comments>
		<pubDate>Thu, 23 Apr 2009 21:36:16 +0000</pubDate>
		<dc:creator>Adi</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[dynamic]]></category>
		<category><![CDATA[getlementbyid]]></category>
		<category><![CDATA[style]]></category>

		<guid isPermaLink="false">http://www.open-source-web.com/?p=132</guid>
		<description><![CDATA[Javascript is probably the most awesome tool a web developer can use to make a website both functional and look nice. Javascript has also evolved over the years with the DOM it has become much easier to develop. One useful piece of code I always end up using when writing Javascript is getElementById, the way [...]]]></description>
			<content:encoded><![CDATA[<p>Javascript is probably the most awesome tool a web developer can use to make a website both functional and look nice. <strong>Javascript </strong>has also evolved over the years with the DOM it has become much easier to develop.</p>
<p>One useful piece of code I always end up using when writing Javascript is <strong>getElementById</strong>, the way Javascript evolved has given it much more compatibility with different browsers and in turn means you need less code to do more.</p>
<p><strong>getElementById</strong> allows you to modify any html element with a given ID. so for example if you have a &lt;div&gt; with the ID jstest it might look like this</p>
<p>&lt;div id=&#8221;jstest&#8221;&gt;howdy&lt;/div&gt;</p>
<p>Using <strong>document.getElementById(&#8216;jstest&#8217;)</strong> we can modify this element dynamically with javascript changing anything from its appearance or position with styling or use it within our javascript code.</p>
<p>using <strong>document.getElementById(&#8216;jstest&#8217;).innerHTML</strong> we could change or get the contents of the div.</p>
<p>Another pretty awesome use for the getElementById method would be to change the style of an element dynamically, maybe you want it to disappear when clicked or have a border when highlighted.</p>
<p>To change the background of an element we could use document.getelementById(&#8216;jstest&#8217;).style.background-color = &#8216;#dedede&#8217;  this will work with any styling you could apply to an element.</p>
<p>If you are like 90% of the old school web developers I know you probably don&#8217;t like using javascript but the modern DOM it is couldn&#8217;t be easier.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.open-source-web.com/javascript/javascript-get-element-by-id/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google Charts Example</title>
		<link>http://www.open-source-web.com/php/google-charts-example/</link>
		<comments>http://www.open-source-web.com/php/google-charts-example/#comments</comments>
		<pubDate>Sat, 07 Mar 2009 18:14:03 +0000</pubDate>
		<dc:creator>Adi</dc:creator>
				<category><![CDATA[API's]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[chart]]></category>
		<category><![CDATA[dynamic]]></category>
		<category><![CDATA[google]]></category>

		<guid isPermaLink="false">http://www.open-source-web.com/?p=117</guid>
		<description><![CDATA[API&#8217;s are becoming more popular on the web as many of the big online companies such as Google, Yahoo and Facebook offer there own open source code for web developers to use freely and easily. To begin with I am going to go through how to use the Charts Basics API from Google. This is [...]]]></description>
			<content:encoded><![CDATA[<p>API&#8217;s are becoming more popular on the web as many of the big online companies such as Google, Yahoo and Facebook offer there own open source code for web developers to use freely and easily.</p>
<p><img src="http://chart.apis.google.com/chart?chs=250x100&amp;chd=t:10,80,35,10&amp;cht=lc&amp;chl=wk1|wk2|wk3|wk4" alt="Google Charts Basics" /></p>
<p>To begin with I am going to go through how to use the Charts Basics API from Google. This is an extremely easy one to start off with as you don&#8217;t require an API key or to install anything, you don&#8217;t even need a dynamic server side script to get some nice results.</p>
<p>For this example I am going to jazz it up with a bit of PHP using an associative array but you can easily replace this with a database or XML feed.</p>
<p>To call a chart we use the query string linking to the API which will end up looking something like this.</p>
<pre id="line1">&lt;<span class="start-tag">img</span><span class="attribute-name"> src</span>=<span class="attribute-value">"http://chart.apis.google.com/chart?chs=250x100&amp;amp;chd=t:10,80,35,10&amp;amp;cht=lc&amp;amp;chl=wk1|wk2|wk3|wk4"
</span><span class="attribute-name">alt</span>=<span class="attribute-value">"Sample chart" </span><span class="error"><span class="attribute-name">/</span></span>&gt;</pre>
<p>To generate this dynamicaly I used the following code</p>
<pre class="php" name="code">$arr = array();

$arr['Jan']['wk1'] = 10;
$arr['Jan']['wk2'] = 80;
$arr['Jan']['wk3'] = 35;
$arr['Jan']['wk4'] = 10;

$chart= 'http://chart.apis.google.com/chart?';
$chartsize = 'chs=250x100';
$type = "cht=lc";
$vals = 'chd=t:';
$keys = 'chl=';
$alt = "January";

foreach( $arr['Jan'] as $key =&gt; $value){
	$vals .= $value.',';
	$keys .= $key.'|';
	}</pre>
<p>And Lastly to pull all the code together.</p>
<pre class="php" name="code">
&lt;img src="&lt;? echo $chart;?&gt;
&lt;? echo $chartsize;?&gt;
&amp;amp;&lt;? echo substr("$vals", 0, -1);?&gt;
&amp;amp;&lt;? echo $type;?&gt;
&amp;amp;&lt;? echo substr("$keys", 0, -1);?&gt;"
alt="Sample chart" /&gt;
</pre>
<p>To develop this example further use the official documentation available here <a title="Google Chart Basic" rel="nofollow" href="http://code.google.com/apis/chart/" target="_blank">Google Chart Basic</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.open-source-web.com/php/google-charts-example/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

