[SWFObject] Short Param name problem

Geoff Stearns geoff at deconcept.com
Thu Sep 28 08:36:15 PDT 2006


did you try the very latest version of swfobject? a few months back  
there was a change to the getQueryParamValue function that may have  
fixed this already.

try out v1.4.4


On Sep 28, 2006, at 10:47 AM, Nathan L.Hoover wrote:

> Hello all,
>
> I have been using the 1.4 version of SWFObject for about six months,
> and are loving the script. It definitely solves a lot of my usability
> problems.
>
> However, after implementing a new online store, I found an issue with
> the getQueryParamValue function for the embed. The problem was that  
> the
> store was adding a GET variable for "osCid", and my SWF is using a GET
> variable named "d". So if the osCid variable was set, the SWFObject
> embed would pick it up and assign it to my d variable. Obviously, this
> produced non-expected results.
>
> I fixed the problem by modifying the getRequestParameter function on
> line 118:
>
> // Modified the getRequestParameter function to account for short GET
> variable names that
> // may be part of a larger GET variable name
> 	deconcept.util={getRequestParameter:function(_2b)
> 	{
> 		var q=document.location.search||document.location.hash;
> 		if(q)
> 		{
> 			var _2d=q.indexOf("?"+_2b+"=");
> 			if( _2d == -1 )
> 				_2d=q.indexOf("&"+_2b+"=");
> 			
> 			if(q.length > 1 && _2d > -1 )
> 			{
> 				var _2e=(q.indexOf("&",_2d) > -1) ? q.indexOf("&",_2d):q.length;
> 				return q.substring(q.indexOf("=",_2d)+1,_2e);
> 			}
> 		}
> 		return "";
> 	}
> This is in no way an elegance solution to the problem, but it works  
> for
> me. Thanks for all of the hard work.
>
> 												Nathan
>
> _______________________________________________
> SWFObject mailing list
> SWFObject at lists.deconcept.com
> http://lists.deconcept.com/listinfo.cgi/swfobject-deconcept.com




More information about the Swfobject mailing list