<?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>yesJames.com &#187; get parameter</title>
	<atom:link href="http://www.yesjames.com/index.php/tag/get-parameter/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.yesjames.com</link>
	<description>ahuh... sure... what ever you say...</description>
	<lastBuildDate>Fri, 21 Oct 2011 05:16:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>howto: GET a URL parameter in JavaScript</title>
		<link>http://www.yesjames.com/index.php/2008/02/howto-get-a-url-parameter-in-javascript/</link>
		<comments>http://www.yesjames.com/index.php/2008/02/howto-get-a-url-parameter-in-javascript/#comments</comments>
		<pubDate>Mon, 11 Feb 2008 08:38:01 +0000</pubDate>
		<dc:creator>james</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[get parameter]]></category>
		<category><![CDATA[parameters]]></category>
		<category><![CDATA[url parameter]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://www.yesjames.com/index.php/2008/02/11/howto-get-a-url-parameter-in-javascript/</guid>
		<description><![CDATA[A useful little piece of JavaScript for retrieving a URL parameter (Query String) from your page. If a requested parameter doesn&#8217;t exist it will return an empty string rather than a NULL object. It will also handle the inclusion of anchor tags in the URL and exclude them from possible results. e.g. http://www.yesjames.com/test.php?myparam=justatest calling &#8220;gerURLParam(&#8216;myparam&#8217;) [...]]]></description>
			<content:encoded><![CDATA[<p>A useful little piece of JavaScript for retrieving a URL parameter (Query String) from your page. If a requested parameter doesn&#8217;t exist it will return an empty string rather than a NULL object. It will also handle the inclusion of anchor tags in the URL and exclude them from possible results.</p>
<blockquote><p>e.g. http://www.yesjames.com/test.php?myparam=justatest<br />
calling &#8220;gerURLParam(&#8216;myparam&#8217;) will return &#8220;justatest&#8221;</p></blockquote>
<pre name="code" class="brush: javascript">
function getURLParam(name) {
  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var pattern = "[\\?&amp;]"+name+"=([^&amp;#]*)";
  var regex = new RegExp(pattern);
  var aResult = regex.exec(window.location.href);
  if ( aResult == null ) {
    return "";
  } else {
    return aResult[1];
  }
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.yesjames.com/index.php/2008/02/howto-get-a-url-parameter-in-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

