JavsScript Not working in WP :(
Need your help on a little thingie.
I have this little script which dynamically changes the Ad_Track in the aweber form on that page.
<!-- Aweber Adtracking Script Start -->
<script type="text/javascript">
window.onload=function(){var aw_ref='';var query=window.parent.location.search.substring(1);v ar vars=query.split("&");for(var i=0;i<vars.length;i++){var pair=vars[i].split("=");if(pair[0]=='ref'){aw_ref=pair[1];break } }for(i=0;i<document.forms.length;i++){for(e =0;e<document.forms[i].elements.length;e++){if(document.forms[i].elements[e].name=='meta_adtracking'){document.forms[i].elements[e].value=aw_ref;break } } } }
</script>
<!-- Aweber Adtracking Script Finish -->
Here's how it works:
I send peeps to my site with a /?ref=blabla
and then the script assign "blabla" as the Ad_Track of the prospect.
For some reason, in wordpress, I get an error trying to put this code on my pages.
Any idea why?
Thanks in advance!!!
PS. If someone have another solution it's also cool
Photography in Kenya