faqts : Computers : Programming : Languages : JavaScript

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

2 of 7 people (29%) answered Yes
Recently 2 of 7 people (29%) answered Yes

Entry

How do I force a JavaScript Block's contents to Open in a new window when selected?

Apr 7th, 2008 23:43
ha mo, Steph B,


Below is a Javascript block written for a PHP application.  In a 
nutshell, it presents a 120x240 block advertisement for Google 
Intelligent ads.  
The question is, how would you force this to open in a NEW window when 
someone clicks on the contents of the ad, versus having it open in the 
existing window and thus, taking users away from where they were on 
your site?
Thanks!
Steph
<?php
######################################################################
# PHP-Nuke Block: Google AdSense (block-Google-Ads120x240.php)       #
# Copyright(c) 2004 Steph Benoit - http://64bit.us                   #
# This script is free. You can redistribute it and/or modify         #
# it under the terms of GNU/GLP Version 2                            #
######################################################################
if (eregi("block-Google-Ads120x240.php", $PHP_SELF)) {
Header("Location: index.php");
die();
}
$content = '<center><script type="text/javascript"><!--
google_ad_client = "pub-9490138377710802";
google_ad_width = 120;
google_ad_height = 240;
google_ad_format = "120x240_as";
google_color_border = "CCCCCC";
google_color_bg = "FFFFFF";
google_color_link = "000000";
google_color_url = "666666";
google_color_text = "333333";
//--></script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</center>';
?>
http://www.businessian.com
http://www.computerstan.com
http://www.financestan.com
http://www.healthstan.com
http://www.internetstan.com
http://www.moneyenews.com
http://www.technologystan.com
http://www.zobab.com
http://www.healthinhealth.com