Fixes a bug attaching beacon URL parameters #37

Merged
merged 3 commits into from Apr 16, 2012
View
@@ -373,8 +373,15 @@ boomr = {
return this;
}
+ // if there are already url parameters in the beacon url,
+ // change the first parameter prefix for the boomerang url parameters to &
+ var paramPrefix = '?';
@bluesmoon

bluesmoon Mar 30, 2012

Contributor

Based on boomerang's coding convention, variables should be declared at the start of the function

+ if(impl.beacon_url.indexOf('?') > -1)
@bluesmoon

bluesmoon Mar 30, 2012

Contributor

Also, preferred braces around all block statements.

+ paramPrefix = '&';
+
+
// use document.URL instead of location.href because of a safari bug
- url = impl.beacon_url + '?v=' + encodeURIComponent(BOOMR.version) +
+ url = impl.beacon_url + paramPrefix + 'v=' + encodeURIComponent(BOOMR.version) +
'&u=' + encodeURIComponent(d.URL.replace(/#.*/, ''));
for(k in impl.vars) {