javascript - Display unknown hidden field values on page -


i'm using script data visitor google analytics , pass hidden input fields on form. i'm using script article: http://bit.ly/1pipxrp

if @ working example here (http://codepen.io/saltmktg/pen/meerex - function starts on line 91), can click "show ga info" button , see alerts each piece of data. (you won't see real info because analytics script linked different account, i.e not jsfiddle.) nevertheless, my problem want display data on actual page - without visitor having click "show ga info" button. want them see data right when hit page.

right populatehiddenfields function populates hidden fields when click "show ga info" button. tried things <body onload="populatehiddenfields(this); , window.onload = populatehiddenfields - can't function work elsewhere on page (apart being tied actual form).

please let me know if can provide more info or examples. once again, i'd visibly display visitor's google analytics tracking info on page. in advance , help!

it works perfectly, imagine don't pass form in argument. can make in onload or in dom ready event (as want):

http://codepen.io/anon/pen/ojlwnw

 <body onload="populatehiddenfields(document.forms[0])">  

i make document.forms[0] because form in page. can pass object id or form name.

good luck


Comments

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -