Go Back   CodingForums.com > :: Client side development > JavaScript programming > JavaScript frameworks

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rating: Thread Rating: 3 votes, 3.67 average.
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 03-23-2008, 03:54 PM   PM User | #1
cantthinkofanic
New Coder

 
Join Date: Jan 2008
Location: Lulworth, Dorset, England
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
cantthinkofanic is an unknown quantity at this point
jquery onload

I am using jquery for some fade effects. I also have google maps which stands alone as far as I know. But both work OK. I am trying to introduce a right click piece of code which is also stand alone. When I put onload-"trap()" in the body tag the googlemaps stops but the right click (stop pic downloads) and jquery works OK. I assume it's the onload taking over google maps.

I know that there is a method of doing a jquery onload (I have 1.2.3) but not being a coder I have now idea how to install it. I have seen:

1. $(document).ready(function() {
// put all your jQuery goodness in here.
});

2. function addLoadEvent(func) {
var oldonload = window.onload;
if (typeof window.onload != 'function') {
window.onload = func;
}
else {
window.onload = function() {
if (oldonload) {
oldonload();
}
func();
}
}
}

3. addLoadEvent(nameOfSomeFunctionToRunOnPageLoad);
addLoadEvent(function() {
/* more code to run on page load */
});

Absolutely no idea which of these is suitable or how to fit them in. I would rather jquery do the whole thing.

Can anyone help?
cantthinkofanic is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

Forum Jump


All times are GMT +1. The time now is 05:49 AM.


Advertisement
Log in to turn off these ads.