javascript - Parenthesis and Quotes - is it really this simple? -
if (url) { var parsedurl = new url(url); s.evar17 = parsedurl.href; s.evar19 = parsedurl.host; s.linktrackvars = 'prop6,evar6,prop4,evar5,evar17,evar19'; var ppvarray = s.getpercentpageviewed(s.pagename); s.evar6 = s.prop6 = ppvarray[1] + "|" + ppvarray[2] + "|" + ppvarray[3]; }
as feel enough javascript, encounter stumps me. can't figure out why piece of code not firing. supposed track visitors website exit site , visit first page of new website. websites specific , linked on site. code pulls url can keep track of how many visits new site gets.
i believe should have parenthesis around defined of s.linktrackvars. , double quotes. can give me clues lead me in right direction?
here's think should be: s.linktrackvars=("prop6, evar6, prop4, evar5, evar17, evar19");
thanks! misty
sounds dealing serilization , deserilization of array of objects; , code should read like;
var linktrackvars = { evar17: somevalue ,evar19: somevalue,...};
to serilize, use json format like;
var mytextserilizedversion= json.stringify(linktrackvars);
and deserilize object again, use
var linktrackvars = json.parse(mytextserilizedversion);
Comments
Post a Comment