473,411 Members | 2,093 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,411 software developers and data experts.

Correct code - help.

Hi,

I run a site with Google's AdSense adds and would like to put the following
two scripts into a single, external .js file.

1. Does anybody know if having this external js affects the adds being
displayed or any other problem?
2. Can you help me to get that rigth?

Thanks in advance,
C.

<script type="text/javascript"><!--
google_ad_client = "pub-number";
google_alternate_color = "FFFFFF";
google_ad_width = 120;
google_ad_height = 240;
google_ad_format = "120x240_as";
google_ad_channel ="";
google_ad_type = "text";
google_color_border = "FFFFFF";
google_color_bg = "FFFFFF";
google_color_link = "FF6600";
google_color_url = "006600";
google_color_text = "000000";
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
Jul 23 '05 #1
3 1428
"Claire Lescarret" <cl*****@nul.com> wrote in message
news:1112338663.777036cc09c1ff7dab20f2858d9aef00@t eranews...
Hi,

I run a site with Google's AdSense adds and would like to put the following two scripts into a single, external .js file.

1. Does anybody know if having this external js affects the adds being
displayed or any other problem?
2. Can you help me to get that rigth?

Thanks in advance,
C.


Why? Google may change their ".js" at any time.

http://pagead2.googlesyndication.com/pagead/show_ads.js
Why not just put your code (below) in a second "include" file?

google_ad_client = "pub-number";
google_alternate_color = "FFFFFF";
google_ad_width = 120;
google_ad_height = 240;
google_ad_format = "120x240_as";
google_ad_channel ="";
google_ad_type = "text";
google_color_border = "FFFFFF";
google_color_bg = "FFFFFF";
google_color_link = "FF6600";
google_color_url = "006600";
google_color_text = "000000";
Jul 23 '05 #2
On 4/1/05 6:39 AM, McKirahan wrote 74********************@comcast.com:

Why? Google may change their ".js" at any time.
That's true, thank you.
Why not just put your code (below) in a second "include" file?

What is "include"? Does that mean any different from having the code inside
html files?
google_ad_client = "pub-number";
google_alternate_color = "FFFFFF";
google_ad_width = 120;
google_ad_height = 240;
google_ad_format = "120x240_as";
google_ad_channel ="";
google_ad_type = "text";
google_color_border = "FFFFFF";
google_color_bg = "FFFFFF";
google_color_link = "FF6600";
google_color_url = "006600";
google_color_text = "000000";


Thank you for your time,
C.

Jul 23 '05 #3
"Claire Lescarret" <cl*****@nul.com> wrote in message
news:1112509071.3a4ac1b7eaa5824b15ee9f2b5ed2ab6f@t eranews...
On 4/1/05 6:39 AM, McKirahan wrote 74********************@comcast.com:

Why? Google may change their ".js" at any time.
That's true, thank you.
Why not just put your code (below) in a second "include" file?


What is "include"? Does that mean any different from having the code

inside html files?
google_ad_client = "pub-number";
google_alternate_color = "FFFFFF";
google_ad_width = 120;
google_ad_height = 240;
google_ad_format = "120x240_as";
google_ad_channel ="";
google_ad_type = "text";
google_color_border = "FFFFFF";
google_color_bg = "FFFFFF";
google_color_link = "FF6600";
google_color_url = "006600";
google_color_text = "000000";


Thank you for your time,
C.


A JavaScript "include" is putting code in a separate file which will allow
its easy reuse.

Google does this via

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

You can do this by placing the following in, say, "myGoogle.js"":

google_ad_client = "pub-number";
google_alternate_color = "FFFFFF";
google_ad_width = 120;
google_ad_height = 240;
google_ad_format = "120x240_as";
google_ad_channel ="";
google_ad_type = "text";
google_color_border = "FFFFFF";
google_color_bg = "FFFFFF";
google_color_link = "FF6600";
google_color_url = "006600";
google_color_text = "000000";

and the using this in your Web page:

<script type="text/javascript" src="myGoogle.js"></script>
To reuse it on other pages all you have to do is include 2 lines:

<script type="text/javascript" src="myGoogle.js"></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
Jul 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Tim | last post by:
In an ASP web page I am trying to calculate a value in seconds from two date and times. Can anyone help me find the correct syntax to make this work?!?! (This code below work correctly)...
0
by: ST | last post by:
Hello, I will be posting 2 errors that I just can't seem to figure out (I'll put them in different posts). I have looked all over the internet, and I still can't figure these out! This webapp was...
5
by: blackg | last post by:
Input string not in correct format -------------------------------------------------------------------------------- I am trying to view a picture from a table. I am getting this error Input string...
5
by: Howard Kaikow | last post by:
Why cannot MSFT publish correct/updated info in MSDN and KB? It is to MSFT's advantage to encourage us to migrate old code, and develop new code, with .NET, so they need to take extra care when...
2
by: Brian Henry | last post by:
Tell me if this is the correct reasoning for this situation. I have two objects, both are structures and have identical data in the structure. I place one into a queue object, now if i do a...
1
by: kang jia | last post by:
hi currently i am editing signup page, when user enter deupicated NRIC and click signup, they will go to do_signuppage and read the error message and then after 5 seconds, they will be redirected...
1
by: kang jia | last post by:
hi when user entered particulars in signuppage and click" signup" button, i will direct them to do_signup.php. if say the NRIC is dupicate in datebase, i will redirect them back to signup page...
4
by: yumbelie | last post by:
Hi, I've got an issue where I've created a prototype that contains 2 methods, and a few private variables. The first method simply registers the second method to be an event handler for the...
10
by: onetruelove | last post by:
I want to creat a post like this blog: http://onlinetoefltest.blogspot.com/2007/08/level-c-lesson-1.html When you chose all the answers and click show answer a msg box will appear and tells how...
1
by: differentsri | last post by:
THIS IS AN ASP.NET 1.1 APPLICATION IAM TRYING TO UPDATE THE FIELD BUT I AM NOT ABLE TO UPDATE IT? CAN U TELL THE REASON ? IT IS GIVING THE FOLLOWING ERROR BELOW I HAVE ALSO GIVEN THE CODE OF...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.