472,794 Members | 3,334 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

host's external javascripts disrupt my onload scripts

My web host inserts banner ads into my html pages. The javascript in
these banner ads interferes with the onload triggered javascript
functions in my pages. Whether I trigger my javascript functions
through onload=function() in the body tag or through
window.onload=function name in a script, the host's advertising
javascripts disrupt my javascripts that are supposed to run onload so
that they do not run. I am not able to control the content of the
javascripts my web hosts runs in my pages when ads are inserted in my
pages.

How do I solve this problem?



Javascripts in your advertisements have been disrupting javascripts in
my code that are supposed to trigger "Onload". The ads disrupt my
onload commands whether I put them in the body tag or use
window.onload.

I would like to know what I can do so that my onload javascripts are
not disrupted by the javascript in your ads.
Jul 23 '05 #1
4 2288
David Virgil Hobbs wrote:
My web host inserts banner ads into my html pages. The javascript in
these banner ads interferes with the onload triggered javascript
functions in my pages. Whether I trigger my javascript functions
through onload=function() in the body tag or through
window.onload=function name in a script, the host's advertising
javascripts disrupt my javascripts that are supposed to run onload so
that they do not run. I am not able to control the content of the
javascripts my web hosts runs in my pages when ads are inserted in my
pages.

How do I solve this problem?


put your code inline at the end of your page instead of in the body.onload

HTH

C.
Jul 23 '05 #2
*Colin McKinnon* wrote:
*David Virgil Hobbs* wrote:
My web host inserts banner ads into my html pages. The javascript in
these banner ads interferes with the onload triggered javascript
functions in my pages. Whether I trigger my javascript functions
through onload=function() in the body tag or through
window.onload=function name in a script, the host's advertising
javascripts disrupt my javascripts that are supposed to run onload so
that they do not run. I am not able to control the content of the
javascripts my web hosts runs in my pages when ads are inserted in my
pages.

How do I solve this problem?


put your code inline at the end of your page instead of in the
body.onload


Without testing it I'd assume that the following would help:

if (window.attachEvent) {
window.attachEvent('onload', MyFunction);
}
else if (window.addEventListener) {
window.addEventListener("load", MyFunction, false);
}
else {
window.onload = MyFunction;
}

--
Andrew Urquhart
- FAQ: www.jibbering.com/faq/
- Archive: www.google.com/groups?q=comp.lang.javascript
- My reply address is invalid, see www.andrewu.co.uk/contact/
Jul 23 '05 #3
vi*******@rcn.com (David Virgil Hobbs) wrote in message news:<6e**************************@posting.google. com>...
My web host inserts banner ads into my html pages. The javascript in
these banner ads interferes with the onload triggered javascript
functions in my pages. Whether I trigger my javascript functions
through onload=function() in the body tag or through
window.onload=function name in a script, the host's advertising
javascripts disrupt my javascripts that are supposed to run onload so
that they do not run.
The problem wass that in experimenting with the window.onload=function
name approach in a web page of mine in which the onload javascripts
were being disrupted by the ad code inserted by the web host, I placed
the script containing the window.onload command above the point where
the inserted ad code appears in my page. I did not realize that where
in the page I place the script containing the window.onload command
matters. The script containing the window.onload command in my case
needs to be placed in the code after the point where the inserted ad
code appears in my code and not before the place where the inserted ad
code appears in my code.

I am not able to control the content of the javascripts my web hosts runs in my pages when ads are inserted in my
pages.

How do I solve this problem?



The following words should not have been in the newsgroup post they
were in a letter sent to my web host.
Javascripts in your advertisements have been disrupting javascripts in
my code that are supposed to trigger "Onload". The ads disrupt my
onload commands whether I put them in the body tag or use
window.onload.

I would like to know what I can do so that my onload javascripts are
not disrupted by the javascript in your ads.

After making the post that started this thread, I figured out the
solution. The following code solves the problem, where derf3() is the
function in the onload command in the body tag that is not being
executed due to the javascripts in the ad code inserted by the web
page host.

<script>
function init4()
{
derf3()
}
window.onload = init4;
</script>
I ca'nt help feeling upset that the online sources that explained the
window.onload command, did not bother with explaining that it can
matter where in the code you place the script containing the
window.onload command.
Jul 23 '05 #4
David Virgil Hobbs wrote:
My web host inserts banner ads into my html pages. The javascript in
these banner ads interferes with the onload triggered javascript
functions in my pages. [...]
How do I solve this problem?
Move to another Web space provider. To circumvent the ads and anything
related to them is illegal. The account is for free/cheap because of
the ads.
[...]
Javascripts in your advertisements have been disrupting javascripts in
my code that are supposed to trigger "Onload". The ads disrupt my
onload commands whether I put them in the body tag or use
window.onload.

I would like to know what I can do so that my onload javascripts are
not disrupted by the javascript in your ads.


What's that?
PointedEars
Jul 23 '05 #5

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

Similar topics

1
by: John B. | last post by:
In an effort to turn a little more a module with my pages, I would like to turn my internal javascripts into an external javascript files to supply the information onto a web page. I...
4
by: Smoke | last post by:
We had a javascript calling a Cold Fusion page (.cfm) and it was working for 2 years. Suddenly yesterday or today its decided it doesn't want to work anymore. I'm picking up somebody elses code I...
2
by: sdvoranchik | last post by:
We have an application that contains links that run javascripts to create pages in a separate frame. When these links open an external site, it causes the javascripts to no longer function. When...
6
by: daniel kaplan | last post by:
hi all, very new to this (javascript and the likes) so this might range in the dumb cataegory. when i am saving my external javascripts on the same server as all my HTML and Perl, etc scripts,...
2
by: and | last post by:
Hi I have been validating all day most things are cool but I cant get by this problem. One I have listed the script (JAVASCRIPT ) in all the right placesnot a prob but the validator insists...
3
by: jon | last post by:
Hello, I am new to trying to validate this xhtml so I will try to explain as best I can. Ok, I currently have a draft html file which I am trying to validate to a xhtml. Right now I have a couple...
2
by: stroumf | last post by:
Hey, My problem is the following: I need to use functions from different javascripts and I don't want to load all the javascripts initially. So I need to load the scripts on demand. Now I know...
1
by: Memphis Steve | last post by:
Is it possible to combine multiple javascipts into one file and then call that file from a linked URL in the head section of an XHTML file? Here are the two scripts I want to use with the...
29
by: FreshRob | last post by:
I have been trying to fix this issue the whole of today and have gotten no where. I am developing a new website, and wanted it to display a webpage in lightbox and have an external page added to the...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

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.