Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

Multiple Javascript Question

Hello,
I can't seem to figure out how to run these two scripts on the same page :D .

In the header I have <script type="text/javascript" language="javascript" src="calendar.js"></script>

Then in the body I have the following code placed where I want the calendar to appear<span class="calendar" id="calendartP"></span>

Then I have the following code for dynamic news content place where I want it to appear <script class type="text/javascript" charset="UTF-8" src="tinc?key=DvSWwMiI"></script>

The dynamic news content works, but the calendar does not. Not sure how to code it so they both work.

Thanks so much,
computerpain
[724 byte] By [computerpain] at [2007-11-11 8:46:17]
# 1 Re: Multiple Javascript Question
It's not likely that it has anything to do with the script tags, but rather something in the functions themselves which is causing conflict. I would need to see the code. Also this section is for Java, not Javascript, so I'm moving this to the web development section. If you post the code I can take a look.
JPnyc at 2007-11-11 23:34:45 >
# 2 Re: Multiple Javascript Question
JPnyc,
Thanks so much for responding. The problem is I dont have the code. I found the calendar script on the internet. It calls a server-side script (I believe)... but I don't know what that script is since it is on the server.

Then I got the code for the dynamic news content:
<script class type="text/javascript" charset="UTF-8" src="tinc?key=DvSWwMiI"></script>

I am not sure what that script is either because I believe it is also a server-side script that is called. What can I do?

Thanks,
Computerpain
computerpain at 2007-11-11 23:35:53 >
# 3 Re: Multiple Javascript Question
Then I'm afraid there's not much that can be done. There's nothing wrong with those script tags per se, except I've never seen charset encoding inside one, and the src file doesn't end in .js, but then you said that it does work when the other isn't included, yes?

If that's the case then it has to be some conflict between the 2 scripts. Maybe a variable name in common, or something along those lines.
JPnyc at 2007-11-11 23:36:51 >
# 4 Re: Multiple Javascript Question
Thank you for your help!
computerpain at 2007-11-11 23:37:51 >
# 5 Re: Multiple Javascript Question
Well I didn't actually help, but you're welcome. You still have the same problem you came here with :(
JPnyc at 2007-11-11 23:38:55 >
# 6 Re: Multiple Javascript Question
Its all good! I found another script to displays the date and now have both the scripts working.
computerpain at 2007-11-11 23:39:49 >