/ Published in: JavaScript
Simulates a click on a page with the name you put in the parameter in the onclick function.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<input id="submit" onclick="trackpage('/kontaktudfyldt/')" type="submit" value="<?php _e('Send Email', 'framework') ?>" /> <script type="text/javascript"> // <![CDATA[ var readytosubmit = false; function trackpage (track) { _gaq.push(['_trackPageview',track]); readytosubmit = !readytosubmit; setTimeout(clicksubmit(), 100)} function clicksubmit() { document.getElementById("submit").click(); } // ]]> </script>
URL: http://snippets.reiffs.dk/simuler-et-view-af-en-side-med-javascript-onclick/