<html><div style='background-color:'><P>Try This, put this function in your &lt;head&gt; tags.</P>
<P>------------------</P>
<P>&lt;script type="text/javascript"&gt;</P>
<P>function getparam( name )<BR>{<BR>&nbsp;name = name.replace(/[\[]/,"<A>\\\[").replace(/[\]]/,"\\\</A>]");<BR>&nbsp;var regexS = "[\\?&amp;]"+name+"=([^&amp;#]*)";<BR>&nbsp;var regex = new RegExp( regexS );<BR>&nbsp;var results = regex.exec( window.location.href );<BR>&nbsp;if( results == null )<BR>&nbsp;&nbsp;return "";<BR>&nbsp;else<BR>&nbsp;return results[1];<BR>}</P>
<P><BR>&lt;/script&gt;</P>
<P>-------------------</P>
<P>So, if you had a URL like: <A href="http://www.somesite.co.uk/id200707030607.html?image=5">http://www.somesite.co.uk/id200707030607.html?image=5</A></P>
<P>Then, to get any variable in the URL, sucj as the "image", simply call:</P>
<P>&lt;script&gt;<BR>var&nbsp;showstyle = getparam( 'image');</P>
<P>alert(""+showstyle+"")</P>
<P>&lt;/script&gt;</P>
<P>Hope it helps,</P>
<P>Al...<BR><BR></P>
<BLOCKQUOTE style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #a0c6e5 2px solid; MARGIN-RIGHT: 0px"><FONT style="FONT-SIZE: 11px; FONT-FAMILY: tahoma,sans-serif">
<HR color=#a0c6e5 SIZE=1>
From: <I>Terry Riegel &lt;riegel@clearimageonline.com&gt;</I><BR>Reply-To: <I>"\[JavaScript List\]" &lt;javascript@LaTech.edu&gt;</I><BR>To: <I>"[[JavaScript List]]" &lt;javascript@LaTech.edu&gt;</I><BR>Subject: <I>[Javascript] Reading a variable from the URL</I><BR>Date: <I>Tue, 17 Jul 2007 09:25:36 -0400</I><BR><BR>
<DIV style="MARGIN: 0px"><FONT class=Apple-style-span face=Times size=4><SPAN class=Apple-style-span style="FONT-SIZE: 16px">Hello everyone,</SPAN></FONT></DIV>
<DIV style="MARGIN: 0px"><FONT class=Apple-style-span face=Times size=4><SPAN class=Apple-style-span style="FONT-SIZE: 16px"><BR class=khtml-block-placeholder></SPAN></FONT></DIV>
<DIV style="MARGIN: 0px"><FONT class=Apple-style-span face=Times size=4><SPAN class=Apple-style-span style="FONT-SIZE: 16px">I am working on a simple slideshow. The page will be static with javascript added for interactivity. I would like to read the URL do determine what image is the current image. For example the static page is.</SPAN></FONT></DIV>
<DIV style="MARGIN: 0px"><FONT class=Apple-style-span face=Times size=4><SPAN class=Apple-style-span style="FONT-SIZE: 16px"><BR class=khtml-block-placeholder></SPAN></FONT></DIV>
<DIV style="MARGIN: 0px"><FONT class=Apple-style-span face=Times size=4><SPAN class=Apple-style-span style="FONT-SIZE: 16px">/sites/thebrowns/photos/200707/id200707030607.html</SPAN></FONT></DIV>
<DIV style="MARGIN: 0px"><FONT class=Apple-style-span face=Times size=4><SPAN class=Apple-style-span style="FONT-SIZE: 16px"><BR class=khtml-block-placeholder></SPAN></FONT></DIV>
<DIV style="MARGIN: 0px"><FONT class=Apple-style-span face=Times size=4><FONT class=Apple-style-span size=4><SPAN class=Apple-style-span style="FONT-SIZE: 16px">I</SPAN></FONT><SPAN class=Apple-style-span style="FONT-SIZE: 16px">t could be called like this...</SPAN></FONT></DIV>
<DIV style="MARGIN: 0px"><FONT class=Apple-style-span face=Times size=4><SPAN class=Apple-style-span style="FONT-SIZE: 16px"><BR class=khtml-block-placeholder></SPAN></FONT></DIV>
<DIV style="MARGIN: 0px"><FONT class=Apple-style-span face=Times size=4><SPAN class=Apple-style-span style="FONT-SIZE: 16px">/sites/thebrowns/photos/200707/id200707030607.html?image=5</SPAN></FONT></DIV>
<DIV style="MARGIN: 0px"><FONT class=Apple-style-span face=Times size=4><SPAN class=Apple-style-span style="FONT-SIZE: 16px"><BR class=khtml-block-placeholder></SPAN></FONT></DIV>
<DIV style="MARGIN: 0px"><FONT class=Apple-style-span face=Times size=4><SPAN class=Apple-style-span style="FONT-SIZE: 16px">Since it is static I would like my javascript to parse the URL and set image to 5.</SPAN></FONT></DIV>
<DIV style="MARGIN: 0px"><FONT class=Apple-style-span face=Times size=4><SPAN class=Apple-style-span style="FONT-SIZE: 16px"><BR class=khtml-block-placeholder></SPAN></FONT></DIV>
<DIV style="MARGIN: 0px"><FONT class=Apple-style-span face=Times size=4><SPAN class=Apple-style-span style="FONT-SIZE: 16px"><BR class=khtml-block-placeholder></SPAN></FONT></DIV>
<DIV style="MARGIN: 0px"><FONT class=Apple-style-span face=Times size=4><SPAN class=Apple-style-span style="FONT-SIZE: 16px">Any ideas on how to do this?</SPAN></FONT></DIV>
<DIV style="MARGIN: 0px"><FONT class=Apple-style-span face=Times size=4><SPAN class=Apple-style-span style="FONT-SIZE: 16px"><BR class=khtml-block-placeholder></SPAN></FONT></DIV>
<DIV style="MARGIN: 0px"><FONT class=Apple-style-span face=Times size=4><SPAN class=Apple-style-span style="FONT-SIZE: 16px"><BR class=khtml-block-placeholder></SPAN></FONT></DIV>
<DIV style="MARGIN: 0px"><FONT class=Apple-style-span face=Times size=4><SPAN class=Apple-style-span style="FONT-SIZE: 16px">Thanks for any help.</SPAN></FONT></DIV>
<DIV style="MARGIN: 0px"><FONT class=Apple-style-span face=Times size=4><SPAN class=Apple-style-span style="FONT-SIZE: 16px"><BR class=khtml-block-placeholder></SPAN></FONT></DIV>
<DIV style="MARGIN: 0px"><FONT class=Apple-style-span face=Times size=4><SPAN class=Apple-style-span style="FONT-SIZE: 16px"><BR class=khtml-block-placeholder></SPAN></FONT></DIV>
<DIV style="MARGIN: 0px"><FONT class=Apple-style-span face=Times size=4><SPAN class=Apple-style-span style="FONT-SIZE: 16px">Terry Riegel</SPAN></FONT></DIV><BR>
<P>&gt;_______________________________________________<BR>&gt;Javascript mailing list<BR>&gt;Javascript@LaTech.edu<BR>&gt;https://lists.LaTech.edu/mailman/listinfo/javascript<BR>
<P></FONT></P></BLOCKQUOTE></div><br clear=all><hr>Watch all 9 Live Earth concerts live on MSN -  <a href="http://g.msn.com/8HMAENUK/2731??PS=47575" target="_top">Click Here!</a> </html>