Pass variable to javascript use javascript

Client wants add following tracking code on website:

<script type="text/javascript" src="[CACHEBUSTER]&mpvc=">
  <a href="[CACHEBUSTER]">
    <img src="[CACHEBUSTER]" alt="Click Here" border="0">

To ensure accurate tracking, they want [CACHEBUSTER] can be replaced by a Time Stamp when page reload.

This is the way we use:

<script type="text/javascript">
var currentTime = new Date(); 
var time_stamp = currentTime.getTime(); 

document.write('<scr' + 'ipt type="text/javascript" src="' + time_stamp + '"></scr' + 'ipt>');
document.write("<noscr' + 'ipt>");
document.write('<a href="' + time_stamp + '">');
document.write('<img src="' + time_stamp + '" alt="Click Here" border="0"></a>');
document.write('</noscr' + 'ipt>');
Share this Post:
Digg Google Bookmarks reddit Mixx StumbleUpon Technorati Yahoo! Buzz DesignFloat Delicious BlinkList Furl

Comments are closed.