Skip to content
This repository has been archived by the owner on Apr 15, 2019. It is now read-only.

Commit

Permalink
make param prefix code more concise
Browse files Browse the repository at this point in the history
  • Loading branch information
bluesmoon committed Mar 30, 2012
1 parent 32c5199 commit 603acdc
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions boomerang.js
Original file line number Diff line number Diff line change
Expand Up @@ -385,14 +385,11 @@ boomr = {

// if there are already url parameters in the beacon url,
// change the first parameter prefix for the boomerang url parameters to &
var paramPrefix = '?';
if(impl.beacon_url.indexOf('?') > -1)
paramPrefix = '&';


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

for(k in impl.vars) {
if(impl.vars.hasOwnProperty(k)) {
Expand Down

0 comments on commit 603acdc

Please sign in to comment.