<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.2873" name=GENERATOR></HEAD>
<BODY
style="WORD-WRAP: break-word; khtml-nbsp-mode: space; khtml-line-break: after-white-space">
<DIV dir=ltr align=left>
<DIV dir=ltr align=left><SPAN class=296331402-01062006><FONT face=Arial
color=#0000ff size=2>Geoff.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=296331402-01062006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=296331402-01062006><FONT face=Arial
color=#0000ff size=2>Yep, My bad. I was remembering an earlier incarnation on my
machine which had a full if/else block, so I did have a 3rd return in
there. It then got ditched it when I was looking at compacting/optimising
the code. Been a long day.... :)</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=296331402-01062006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=296331402-01062006><FONT face=Arial
color=#0000ff size=2>Cheers,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=296331402-01062006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=296331402-01062006><FONT face=Arial
color=#0000ff size=2>Aran</FONT></SPAN></DIV></DIV><BR>
<BLOCKQUOTE dir=ltr
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> swfobject-bounces@lists.deconcept.com
[mailto:swfobject-bounces@lists.deconcept.com] <B>On Behalf Of </B>Geoff
Stearns<BR><B>Sent:</B> Thursday, 1 June 2006 11:48 AM<BR><B>To:</B>
swfobject@lists.deconcept.com<BR><B>Subject:</B> Re: [SWFObject] Bug in
getQueryParamValue() function. Slight fix ?<BR></FONT><BR></DIV>
<DIV></DIV>it will still return "" if it doesn't find anything...
<DIV><BR class=khtml-block-placeholder></DIV>
<DIV>the extra return was redundant as it will just do nothing once the loop
is done.</DIV>
<DIV><BR class=khtml-block-placeholder></DIV>
<DIV>you can test this by going to my test page and putting this in the
address bar:</DIV>
<DIV><BR class=khtml-block-placeholder></DIV>
<DIV><FONT class=Apple-style-span size=3><SPAN class=Apple-style-span
style="FONT-SIZE: 12px">javascript:alert(getQueryParamValue("test"));</SPAN></FONT></DIV>
<DIV><FONT class=Apple-style-span size=3><SPAN class=Apple-style-span
style="FONT-SIZE: 12px"><BR class=khtml-block-placeholder></SPAN></FONT></DIV>
<DIV><FONT class=Apple-style-span size=3><SPAN class=Apple-style-span
style="FONT-SIZE: 12px">here's the test page url:</SPAN></FONT></DIV>
<DIV><FONT class=Apple-style-span size=3><SPAN class=Apple-style-span
style="FONT-SIZE: 12px"><A
href="http://dev.deconcept.com/1.4.2_test/swfobject.html">http://dev.deconcept.com/1.4.2_test/swfobject.html</A></SPAN></FONT></DIV>
<DIV><FONT class=Apple-style-span size=3><SPAN class=Apple-style-span
style="FONT-SIZE: 12px"><BR class=khtml-block-placeholder></SPAN></FONT></DIV>
<DIV><FONT class=Apple-style-span size=3><SPAN class=Apple-style-span
style="FONT-SIZE: 12px"><BR class=khtml-block-placeholder></SPAN></FONT></DIV>
<DIV><FONT class=Apple-style-span size=3><SPAN class=Apple-style-span
style="FONT-SIZE: 12px">you'll see it alert an empty
string.</SPAN></FONT></DIV>
<DIV><FONT class=Apple-style-span size=3><SPAN class=Apple-style-span
style="FONT-SIZE: 12px"><BR class=khtml-block-placeholder></SPAN></FONT></DIV>
<DIV><FONT class=Apple-style-span size=3><SPAN class=Apple-style-span
style="FONT-SIZE: 12px"><BR class=khtml-block-placeholder></SPAN></FONT></DIV>
<DIV><FONT class=Apple-style-span size=3><SPAN class=Apple-style-span
style="FONT-SIZE: 12px"><BR class=khtml-block-placeholder></SPAN></FONT></DIV>
<DIV><BR>
<DIV>
<DIV>On May 31, 2006, at 8:23 PM, Aran Rhee wrote:</DIV><BR
class=Apple-interchange-newline>
<BLOCKQUOTE type="cite">
<DIV dir=ltr align=left><SPAN class=687085023-31052006><FONT face=Arial
color=#0000ff size=2>Geoff.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=687085023-31052006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=687085023-31052006><FONT face=Arial
color=#0000ff size=2>Great. </FONT></SPAN><SPAN
class=687085023-31052006><FONT face=Arial color=#0000ff size=2>One thing
though. I think we still need to have an empty string return if it loops
through all the pairs and doesn't find a match. The one return you have at
present returns an empty string only if there is no query string found at
all. ( need 3 returns in total as below) </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=687085023-31052006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=687085023-31052006><FONT face=Arial
color=#0000ff size=2>deconcept.util = <BR>{<BR>getRequestParameter:
function(param) <BR>{<BR>var q = document.location.search ||
document.location.hash;<BR>if(q) <BR>{<BR>var pairs =
q.substring(1).split("&");<BR>for (var i=0; i < pairs.length; i++)
<BR>{<BR>if (pairs[i].substring(0, pairs[i].indexOf("=")) == param)
<BR>{</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=687085023-31052006><FONT face=Arial
color=#0000ff size=2>// return matched key value<BR>return
pairs[i].substring((pairs[i].indexOf("=")+1));<BR>}<BR>}</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=687085023-31052006><FONT face=Arial
color=#0000ff size=2>// empty string if no match found</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=687085023-31052006><FONT face=Arial
color=#0000ff size=2>return "";<BR>}</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=687085023-31052006><FONT face=Arial
color=#0000ff size=2>// empty string if no querystring at all<BR>return
"";<BR>}<BR>}</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=687085023-31052006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=687085023-31052006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=687085023-31052006><FONT face=Arial
color=#0000ff size=2>Cheers,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=687085023-31052006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=687085023-31052006><FONT face=Arial
color=#0000ff size=2>Aran</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=687085023-31052006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=687085023-31052006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=687085023-31052006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN></DIV><BR>
<BLOCKQUOTE dir=ltr
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B>
swfobject-bounces@lists.deconcept.com [<A
href="mailto:swfobject-bounces@lists.deconcept.com">mailto:swfobject-bounces@lists.deconcept.com</A>]
<B>On Behalf Of </B>Geoff Stearns<BR><B>Sent:</B> Thursday, 1 June 2006
1:40 AM<BR><B>To:</B> <A
href="mailto:swfobject@lists.deconcept.com">swfobject@lists.deconcept.com</A><BR><B>Subject:</B>
Re: [SWFObject] Bug in getQueryParamValue() function. Please
fixASAP.<BR></FONT><BR></DIV>
<DIV></DIV>just checked it in, have a look:
<DIV><BR class=khtml-block-placeholder></DIV>
<DIV><FONT class=Apple-style-span size=3><SPAN class=Apple-style-span
style="FONT-SIZE: 12px"><A
href="http://svn.deconcept.com/swfobject/trunk/">http://svn.deconcept.com/swfobject/trunk/</A></SPAN></FONT></DIV>
<DIV><FONT class=Apple-style-span size=3><SPAN class=Apple-style-span
style="FONT-SIZE: 12px"><BR
class=khtml-block-placeholder></SPAN></FONT></DIV>
<DIV><BR>
<DIV>
<DIV>On May 31, 2006, at 11:29 AM, Geoff Stearns wrote:</DIV><BR
class=Apple-interchange-newline>
<BLOCKQUOTE type="cite">nice catch - i like your compact version better
than my fix for it, so if you don't mind i'll roll it into the next
version:
<DIV><BR class=khtml-block-placeholder></DIV>
<DIV>deconcept.util = {</DIV>
<DIV><SPAN class=Apple-tab-span
style="WHITE-SPACE: pre"></SPAN>getRequestParameter: function(param)
{</DIV>
<DIV><SPAN class=Apple-tab-span style="WHITE-SPACE: pre"></SPAN>var q =
document.location.search || document.location.hash;</DIV>
<DIV><SPAN class=Apple-tab-span style="WHITE-SPACE: pre"></SPAN>if(q)
{</DIV>
<DIV><SPAN class=Apple-tab-span style="WHITE-SPACE: pre"></SPAN>var
pairs = q.substring(1).split("&");</DIV>
<DIV><SPAN class=Apple-tab-span style="WHITE-SPACE: pre"></SPAN>for (var
i=0; i < pairs.length; i++) {</DIV>
<DIV><SPAN class=Apple-tab-span style="WHITE-SPACE: pre"></SPAN>if
(pairs[i].substring(0, pairs[i].indexOf("=")) == param) {</DIV>
<DIV><SPAN class=Apple-tab-span style="WHITE-SPACE: pre"></SPAN>return
pairs[i].substring((pairs[i].indexOf("=")+1));</DIV>
<DIV><SPAN class=Apple-tab-span style="WHITE-SPACE: pre"></SPAN>}</DIV>
<DIV><SPAN class=Apple-tab-span style="WHITE-SPACE: pre"></SPAN>}</DIV>
<DIV><SPAN class=Apple-tab-span style="WHITE-SPACE: pre"></SPAN>}</DIV>
<DIV><SPAN class=Apple-tab-span style="WHITE-SPACE: pre"></SPAN>return
"";</DIV>
<DIV><SPAN class=Apple-tab-span style="WHITE-SPACE: pre"></SPAN>}</DIV>
<DIV>}</DIV>
<DIV><BR class=khtml-block-placeholder></DIV>
<DIV>i'm going to check this into the svn repository in a few mins, i
have a couple other things to test first.</DIV>
<DIV><BR class=khtml-block-placeholder></DIV>
<DIV><BR class=khtml-block-placeholder></DIV>
<DIV><BR>
<DIV>
<DIV>On May 31, 2006, at 12:17 AM, Aran Rhee wrote:</DIV><BR
class=Apple-interchange-newline>
<BLOCKQUOTE type="cite">
<DIV>
<DIV dir=ltr align=left><FONT face=Arial size=2><SPAN
class=328255203-31052006>Geoff.</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial size=2><SPAN
class=328255203-31052006></SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial size=2><SPAN
class=328255203-31052006>I believe I have found a bug in your query
params function with swfObject. The way you are returning values from
your search means that it will return the value of the 1st parameter
which contains the substring of the name passed into
getQueryParamValue(), not necessarily the actual value you want!
</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial size=2><SPAN
class=328255203-31052006></SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial size=2><SPAN
class=328255203-31052006>e.g. </SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial size=2><SPAN
class=328255203-31052006></SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial size=2><SPAN
class=328255203-31052006>somepage.html?myEmailName=<A
href="mailto:aaaa@aaaa.com">aaaa@aaaa.com</A>&Email=<A
title=mailto:somepage.html?myEmailName=aaaa@aaaa.com&Email=xxxx@xxxx.com
href="mailto:somepage.html?myEmailName=aaaa@aaaa.com&Email=xxxx@xxxx.com">xxxx@xxxx.com</A></SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial size=2><SPAN
class=328255203-31052006></SPAN></FONT><FONT face=Arial
size=2></FONT></DIV>
<DIV dir=ltr align=left><SPAN class=328255203-31052006><FONT
face=Arial size=2>getQueryParamValue('Email');</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=328255203-31052006><FONT
face=Arial size=2></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=328255203-31052006><FONT
face=Arial size=2>will actually return </FONT><A
title=mailto:aaaa@aaaa.com href="mailto:aaaa@aaaa.com"><FONT
title=mailto:aaaa@aaaa.com face=Arial color=#000000
size=2>aaaa@aaaa.com</FONT></A><FONT face=Arial size=2>,
</FONT></SPAN><SPAN class=328255203-31052006><FONT face=Arial
size=2>as the value as "Email" was found in the 1st param name
string.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=328255203-31052006><FONT
face=Arial size=2></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=328255203-31052006><FONT
face=Arial size=2></FONT></SPAN></DIV>
<DIV dir=ltr align=left><FONT face=Arial><FONT size=2><SPAN
class=328255203-31052006>I think you need to actually split the params
into an array and do a full text match. I wrote the below as a fix for
myself quickly, and it</SPAN><SPAN class=328255203-31052006><SPAN
class=281261404-31052006>designed to be readable, not</SPAN> compact,
but you get the idea.</SPAN></FONT></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial size=2><SPAN
class=328255203-31052006></SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial size=2><SPAN
class=328255203-31052006>function getRequestParameter
(key)<BR>{<BR>var q = document.location.search ||
document.location.hash;<BR>if(q)<BR>{<BR>var qArray =
q.substring(1).split("&");<BR>var len = qArray.length;<BR>for (i =
0; i<len; i++)<BR>{<BR>var pair = qArray[i];<BR>var splitIndex =
pair.indexOf("=");<BR>var paramName = pair.substring(0,
splitIndex);<BR>var paramValue= pair.substring((splitIndex+1));<BR>if
(paramName == key)<BR>{<BR>return paramValue;<BR>}<BR>}<BR>return
"";<BR>}<BR>return "";<BR>}</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial size=2><SPAN
class=328255203-31052006></SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial size=2><SPAN
class=328255203-31052006></SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial size=2><SPAN
class=328255203-31052006><SPAN class=281261404-31052006>You could
compact it like:</SPAN></SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial size=2><SPAN
class=328255203-31052006><SPAN
class=281261404-31052006></SPAN></SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial size=2><SPAN
class=328255203-31052006><SPAN class=281261404-31052006>function
getRequestParameter (key) {<BR>var q = document.location.search ||
document.location.hash;<BR>if(q) {<BR>var qArray =
q.substring(1).split("&");<BR>for (i = 0; i<qArray.length; i++)
{<BR>if (qArray[i].substring(0, qArray[i].indexOf("=")) == key) return
qArray[i].substring((qArray[i].indexOf("=")+1));<BR>}<BR>return
"";<BR>}<BR>return "";<BR>}</SPAN></SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial size=2><SPAN
class=328255203-31052006><SPAN
class=281261404-31052006></SPAN></SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial size=2><SPAN
class=328255203-31052006><SPAN
class=281261404-31052006></SPAN></SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial size=2><SPAN
class=328255203-31052006></SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial size=2><SPAN
class=328255203-31052006></SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial size=2><SPAN
class=328255203-31052006>Cheers,</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial size=2><SPAN
class=328255203-31052006></SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial size=2><SPAN
class=328255203-31052006>Aran</SPAN></FONT></DIV></DIV>
<DIV
style="MARGIN: 0px">_______________________________________________</DIV>
<DIV style="MARGIN: 0px">SWFObject mailing list</DIV>
<DIV style="MARGIN: 0px"><A
href="mailto:SWFObject@lists.deconcept.com">SWFObject@lists.deconcept.com</A></DIV>
<DIV style="MARGIN: 0px"><A
href="http://lists.deconcept.com/listinfo.cgi/swfobject-deconcept.com">http://lists.deconcept.com/listinfo.cgi/swfobject-deconcept.com</A></DIV></BLOCKQUOTE></DIV><BR></DIV>
<DIV
style="MARGIN: 0px">_______________________________________________</DIV>
<DIV style="MARGIN: 0px">SWFObject mailing list</DIV>
<DIV style="MARGIN: 0px"><A
href="mailto:SWFObject@lists.deconcept.com">SWFObject@lists.deconcept.com</A></DIV>
<DIV style="MARGIN: 0px"><A
href="http://lists.deconcept.com/listinfo.cgi/swfobject-deconcept.com">http://lists.deconcept.com/listinfo.cgi/swfobject-deconcept.com</A></DIV></BLOCKQUOTE></DIV><BR></DIV></BLOCKQUOTE>
<DIV
style="MARGIN: 0px">_______________________________________________</DIV>
<DIV style="MARGIN: 0px">SWFObject mailing list</DIV>
<DIV style="MARGIN: 0px"><A
href="mailto:SWFObject@lists.deconcept.com">SWFObject@lists.deconcept.com</A></DIV>
<DIV style="MARGIN: 0px"><A
href="http://lists.deconcept.com/listinfo.cgi/swfobject-deconcept.com">http://lists.deconcept.com/listinfo.cgi/swfobject-deconcept.com</A></DIV></BLOCKQUOTE></DIV><BR></DIV></BLOCKQUOTE></BODY></HTML>