Take the 2-minute tour ×

I have some javascript popup works fine in html.

I know how the popup works,

but when Im trying to modify and use the codes in page.tpl.php, all of them always fail

is drupal always strip popup? and how to make it works?

thanks in advance

-----added----- (i know this codes is dirty)

in <head></head>:

<script type="text/javascript"> 
//default pop-under house ad url 
infinityads_enable_pop = true; 
infinityads_frequencyCap =0;
durl = '';
infinityads_layer_border_color = '';
infinityads_layer_ad_bg = '';
infinityads_layer_ad_link_color = '';
infinityads_layer_ad_text_color = '';
infinityads_text_link_bg = '';
infinityads_text_link_color = '';
infinityads_enable_text_link = false;
<script type="text/javascript" src="http://localhost/jjj/js.js"></script>

in http://localhost/jjj/js.js:

document.write("<img src=\"http://www.myroitracking.com/newServing/tracking_id.php?d=ads.lzjl.com&r=http%3A%2F%2Fads.lzjl.com%2FnewServing%2Ftracking_id.php%3Fb%3D1%26&gtruid=1\" width=\"1\" height=\"1\" />");
private_label_prefix = "infinityads";
infinityads_company_name = "infinityads.com";
infinityads_static_host = "static.hatid.com";
infinityads_service = "ads.lzjl.com";
infinityads_image_base_url = "http://creative.hatid.com/network_default/network_5/";
infinityads_search_base_url = "http://ads.lzjl.com/newServing/yesupSearch/web.php?q=";
infinityads_adhere_url = "http://infinityads.com";
infinityads_widget_title = "Clicksor Connect";
infinityads_widget_title_link = "http://www.clicksor.com/connect-widget";
infinityads_pub_host = "publisher.infinityads.com";
document.write("<iframe src=\"http://ads.clicksor.com/newServing/searchTrack.php?nid=5&random=439915900\" width=\"1px\" height=\"1px\" frameborder=\"0\" scrolling=\"no\" style=\"position:absolute;z-index:9999301;\"></iframe>");

if ( typeof(Yesup) == "undefined" ) {
        document.write('<script type="text/javascript" src="http://localhost/jjj/show_ad.js"></script>');
    }  else {

in http://localhost/jjj/show_ad.js is in this URL:

share|improve this question
add comment

1 Answer

Drupal strips out scripts in pages you input through its CMS if it's set to sanitize them. It shouldn't be stripping out code in templates.

Can you post the template file?

share|improve this answer
the codes has been added above. i have tried many ways with no luck, including the position of javascript in page.tpl.php –  Lindsay Lohan Jul 31 '10 at 1:12
Is the file referenced on localhost actually available? Is this site intended to work only when viewed on the server? –  interfect Jul 31 '10 at 1:39
localhost is only for testing.. and yes, its actually available –  Lindsay Lohan Jul 31 '10 at 2:08
it works now. thanks –  Lindsay Lohan Jul 31 '10 at 3:39
add comment

Your Answer


