Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I create a passback tag from a URL?

I have a couple of ad networks that have been able to integrate a passback URL (requested when a paid ad impression is not available) but one ad network can only accept a passback script tag, which I don't have.

The passback script needs to load the contents of a URL (a 728x90 image or flash banner) into itself (it also needs to execute the Javascript that it loads). Can anyone help me construct a passback script tag?

I tried this:

<SCRIPT language="Javascript">

// loads within itself, in the 728x90 banner space

document.write("<SCR"+"IPT language=\'Javascript\' src=\'http://www.mydomain.com/passback.php\'></SCR"+"IPT>");

</SCRIPT>

But got script errors. Any ideas?

like image 435
Tom Avatar asked Nov 09 '11 15:11

Tom


1 Answers

Just an idea. What does it give if you try this ?

<SCRIPT language="JavaScript" type="text/javascript">

var script = document.createElement("script");
script.type = "text/javascript";  // This is for HTML 4.01 validation
script.src = "http://www.mydomain.com/passback.php";
document.getElementsByTagName("head")[0].appendChild(script);

</SCRIPT>
like image 62
Luc125 Avatar answered Oct 20 '22 04:10

Luc125