Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Javascript of Google inside my javascript file

Reply
Thread Tools

Javascript of Google inside my javascript file

 
 
Antonio
Guest
Posts: n/a
 
      05-21-2004
Good Morning,
I would want to insert the javascript of google adsense in my site,
here it is :

<script type="text/javascript"><!--
google_ad_client = "pub-4902392511135327";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_channel ="";
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>


the problem is that I want to insert it inside a javascript file I
already use in a way that I've not to insert it in every page, how can
I do this, in expecially way, how can i formulate the

<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>

when I am inside another javascript file ???

Thanks

Ing. Antonio D'Ottavio
 
Reply With Quote
 
 
 
 
Ivo
Guest
Posts: n/a
 
      05-21-2004
"Antonio" wrote
> Good Morning,
> I would want to insert the javascript of google adsense in my site,
> here it is :
>
> <script type="text/javascript"><!--
> google_ad_client = "pub-4902392511135327";
> google_ad_width = 728;
> google_ad_height = 90;
> google_ad_format = "728x90_as";
> google_ad_channel ="";
> //--></script>
> <script type="text/javascript"
> src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
> </script>
>
> the problem is that I want to insert it inside a javascript file I
> already use in a way that I've not to insert it in every page, how


var x=document.createElement('script');
x.src="http://pagead";

I think you can only create elements after the initial onload event has
fired (and only on newer browsers), so put it in a function.
To include the file even the before load, make an empty script tag the first
in each document and set document.srcipts[0].src explicitly in your own .js
file (IE only I think).
HTH
Ivo


 
Reply With Quote
 
 
 
 
Antonio
Guest
Posts: n/a
 
      05-21-2004
I made this :

function InserisciFooter()
{
document.write('<img src="' + base + 'images/barraFooter.png"
width="750" align="center">');

google_ad_client = "pub-4902392511135327";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_channel ="";
google_ad_type = "text_image";
google_color_border = ["B4D0DC","A8DDA0","578A24"];
google_color_bg = ["ECF8FF","EBFFED","CCFF99"];
google_color_link = ["0000CC","0000CC","00008B"];
google_color_url = ["008000","008000","00008B"];
google_color_text = ["6F6F6F","6F6F6F","000000"];
var x=document.createElement('script');
x.src="http://pagead2.googlesyndication.com/pagead/show_ads.js";
};

but there is nothing in the resulting page,
have you an idea of other solution ???

Thanks in any case



"Ivo" <(E-Mail Removed)> wrote in message news:<40adad88$0$72192$(E-Mail Removed)>.. .
> "Antonio" wrote
> > Good Morning,
> > I would want to insert the javascript of google adsense in my site,
> > here it is :
> >
> > <script type="text/javascript"><!--
> > google_ad_client = "pub-4902392511135327";
> > google_ad_width = 728;
> > google_ad_height = 90;
> > google_ad_format = "728x90_as";
> > google_ad_channel ="";
> > //--></script>
> > <script type="text/javascript"
> > src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
> > </script>
> >
> > the problem is that I want to insert it inside a javascript file I
> > already use in a way that I've not to insert it in every page, how

>
> var x=document.createElement('script');
> x.src="http://pagead";
>
> I think you can only create elements after the initial onload event has
> fired (and only on newer browsers), so put it in a function.
> To include the file even the before load, make an empty script tag the first
> in each document and set document.srcipts[0].src explicitly in your own .js
> file (IE only I think).
> HTH
> Ivo

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Updating a file inside a .war available inside .ear niceguyii Software 0 11-09-2011 01:37 PM
File upload inside a usercontrol inside an updatepanel Leon Mayne ASP .Net 5 05-27-2008 09:02 AM
Firefox google search bar searches google.de Abso Firefox 3 01-06-2005 10:55 PM
How to get the Javascript file name from a function inside the file. ryanmhuc@yahoo.com Javascript 16 12-23-2004 02:40 PM
Re: Can We Use EXEC CGI Inside a JavaScript Applet Inside an HTML File? David Dorward HTML 1 06-28-2003 09:30 AM



Advertisments