Forum Moderators: open
<!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Test</title>
<script type="text/javascript">
function spotTag() {
var axel = Math.random()+"";
var a = axel * 10000000000000;
document.write('<IMG SRC="http://example.com/test.gif='+ a + '?" WIDTH=1 HEIGHT=1 BORDER=0/>');
}
</script>
</head>
<body>
<img alt="" src="placeholder.gif" width="126" border="0" height="19" alt="Img" usemap="#download_form" onClick="spotTag()" />
<div>
<map id="img_map" name="img_map">
<area shape="rect" coords="1,0,126,17" target="_blank" href="example" onClick="spotTag();"/>
</map>
</div>
</body>
</html>
[edited by: Fotiman at 12:49 pm (utc) on Apr 27, 2010]
document.write('<IMG SRC="http://example.com/test.gif='+ a + '?" WIDTH=1 HEIGHT=1 BORDER=0/>');
document.write('<iframe src="http://example.com/activity;src=blah;type=blah;cat=blah;ord=1' + a + '?" width="1" height="1" frameborder="0"></iframe>');
Does it matter if one uses onclick="spotTag();" or onclick="javascript:spotTag();" ?
when does one add "return false;" ?
function spotTag(url) {
if (document.getElementById('placeholder')) {
var img = document.getElementById('placeholder');
var axel = Math.random()+"";
var a = axel * 10000000000000;
img.src='test.gif?'+a;
}
var day = new Date();
var id = day.getTime();
var params = 'width=600,height=600,scrollbars,resizable';
var win = open(url,id,params);
return false;
}
[edited by: Fotiman at 12:51 pm (utc) on Apr 27, 2010]