Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 02-05-2003, 08:21 PM   #1
harvey
Confirmed User
 
harvey's Avatar
 
Industry Role:
Join Date: Jul 2001
Location: 127.0.0.1
Posts: 9,266
Javascrip help

I have 2 javascript codes (one to preload images and one pop-up) that use "BODY onLoad", but I can make to work only one of them at a time, what can I do to make it work?
__________________
This post is endorsed by CIA, KGB, MI6, the Mafia, Illuminati, Kim Jong Il, Worldwide Ninjas Association, Klingon Empire and lolcats. Don't mess around with it, just accept it and embrace the truth
harvey is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-05-2003, 08:24 PM   #2
mike503
Confirmed User
 
Industry Role:
Join Date: May 2002
Location: oregon.
Posts: 2,243
look for one that returns false, it might be messing it up. or make a new function

function pops_suck() {
popup_function();
other_function();
return true;
}

and call that single function from the body onload... should work.
__________________
php/mysql guru. hosting, coding, all that jazz.
mike503 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-05-2003, 08:25 PM   #3
jimmyf
OU812
 
Join Date: Feb 2001
Location: California
Posts: 12,651
Adding more than one JavaScript to a page

The solution

The way to go about solving this conflict is simple,
though not quite the same to explain. Essentially, what
you want is to end up with only ONE delta for both scripts,
with that delta calling the two scripts. Let's list some
possible scenarios now, and their resolutions:

EXAMPLE #1:
SCRIPT 1: <body onload="dothis()">
SCRIPT 2: <body onload="dothat()">
RESOLUTION: <body onload="dothis();dothat()">

EXAMPLE #2:
SCRIPT 1: <body onload="dothis()">
SCRIPT 2: window.onload=dothat()
RESOLUTION: <body onload="dothis();dothat()">

EXAMPLE #3:
SCRIPT 1: window.onload=dothis
SCRIPT 2: window.onload=dothat
RESOLUTION: <body onload="dothis();dothat()">

As you can see, regardless of whether the two scripts contain
"delta" or "beta", the resolution is the same- remove BOTH lines,
and call the scripts directly within the <body> tag, each separated
by a semicolon. If you wish to combine three scripts, the procedure
is the exact same.

By using the above technique, both scripts are called and executed,
as opposed to just one- or neither. In other words, conflict avoided!
Check out http://www.javascriptkit.com/javatut...taction4.shtml
for some additional information on resolving script conflicts.

By the why I got above by doing a search.
__________________
Epic CashEpic Cash works for me
Solar Cash Paysite Plugin
Gallery of the day freesites,POTD,Gallery generator with free hosting

Last edited by jimmyf; 02-05-2003 at 08:26 PM..
jimmyf is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-05-2003, 10:14 PM   #4
harvey
Confirmed User
 
harvey's Avatar
 
Industry Role:
Join Date: Jul 2001
Location: 127.0.0.1
Posts: 9,266
thanx guys, problem solved
__________________
This post is endorsed by CIA, KGB, MI6, the Mafia, Illuminati, Kim Jong Il, Worldwide Ninjas Association, Klingon Empire and lolcats. Don't mess around with it, just accept it and embrace the truth
harvey is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.