•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 391,774 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,440 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 602 | Replies: 4 | Solved
![]() |
•
•
Join Date: Mar 2008
Location: Lagos, Nigeria
Posts: 69
Reputation:
Rep Power: 1
Solved Threads: 5
I'm having an issue getting two Javascripts to work on one page. It seems that one disables the other and only one is working when previewed together. I know of a code that can be inserted so that both codes can function on one page, but I just can't lay my hands on it right now.
So, can anyone here provide me such code, please?
So, can anyone here provide me such code, please?
Several questions:
1. How are you starting the scripts? If you don't specify how they start (i.e. onclick, etc.), only the last one defined in the body tag will start.
2. Are the scripts in the header? Scripts in the header will not run until told to by a command in a tag in the body.
3. Did you think of calling one script from the other?
4. Do the scripts have some variable names in common? Make sure they do not share variable names. All global variables will keep their values from one script to the other.
1. How are you starting the scripts? If you don't specify how they start (i.e. onclick, etc.), only the last one defined in the body tag will start.
2. Are the scripts in the header? Scripts in the header will not run until told to by a command in a tag in the body.
3. Did you think of calling one script from the other?
4. Do the scripts have some variable names in common? Make sure they do not share variable names. All global variables will keep their values from one script to the other.
Last edited by MidiMagic : Apr 14th, 2008 at 2:58 pm.
Daylight-saving time uses more gasoline
Or a better way would be to encapsulate all the functions which need to be executed inside a single function and call that function instead.
> It seems that one disables the other and only one is working when previewed together.
We would have no way of knowing what the problem is unless you post some code or provide some more explanation.
<body onload="doAll();">...</body>> It seems that one disables the other and only one is working when previewed together.
We would have no way of knowing what the problem is unless you post some code or provide some more explanation.
"I don't accept change. I don't deserve to live."
"Working a real job is a win if you're lazy, greedy, or unmotivated. If you're average, you fit right in. And if you're above average, the basic terms of employment and premise of the arrangement is against your interests."
"Working a real job is a win if you're lazy, greedy, or unmotivated. If you're average, you fit right in. And if you're above average, the basic terms of employment and premise of the arrangement is against your interests."
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb JavaScript / DHTML / AJAX Marketplace
•
•
•
•
adult advertising ajax article blog browser browsers community dani web data design development domains firefox forensic google help home html intel internet legal linux marketing michael knight microsoft mozilla multimedia navigation news opera php privacy report research rss search security seo software sun survey video w3c web web development wiki xml yahoo youtube
- Previous Thread: AJAX DIV Refresh Help....
- Next Thread: Using a popup to fill an input field



Linear Mode