If the two JavaScript files contained correctly written JavaScript then you'd be able to simply include script tags for both in your page and both would work.
That they don't work means that neither script is written properly and has exposed variables or event handlers that the other script has also left exposed and those are clashing.
You should rewrite at least one and preferably both scripts to remove whatever it is they are placing in the global space so that they can no longer interfere with anything else in the page.
Whatever you do - don't jumble the JavaScript into the HTML file as that will just make things worse.
Also, the file prototype.js sounds like the JavaScript framework of that same name. What code does slide.js contain? Perhaps changing the order of inclusion would help (i. e. prototype.js first and then slide.js below that.
Thanks for the replies guys.. Just to see I placed prototype.js first and it didnt do anything here is thed code thats in the slide.js
Code:
$(document).ready(function() {
// Expand Panel
$("#open").click(function(){
$("div#panel").slideDown("slow");
});
// Collapse Panel
$("#close").click(function(){
$("div#panel").slideUp("slow");
});
// Switch buttons from "Log In | Register" to "Close Panel" on click
$("#toggle a").click(function () {
$("#toggle a").toggle();
});
});
The code for prototype.js its too long to post in this one and to be honest I am not great at understanding JS code.. What it is for is a newsletter subscription. I will post in in the next comment
There we go. That looks like jQuery in there. You shouldn’t use two different JavaScript frameworks at once. Decide for one, either prototype or jQuery, and stick with it.
Or learn JavaScript language. If so, you will be able either to create your own codes or to understand what the varied JS frameworks do in order to avoid the collision.
Dang Ok so I wont be able to use those 2 together then unless I learn JavaScript... Anyone know of a easy Newsletter signup script I will be able to use in place of this one?
I would love to use jquery for it. What I have done with jquery so far has been great!
It is just a simple form where a user would enter their name and their email address and then click signup and the prototype.js will validate what they entered to be a true email address and after it passes it to my database it will display a thank you below the form boxes
The JS cracks here will probably tell you that for such a simple action it’s overkill to use a JS framework and I agree. But I’m not enough of a JS crack to be able to give you a no-framework solution right away. Something similar to the example you showed can of course be achieved with the form plugin for jQuery. It probably requires a little more insight but the documentation is pretty good and you can always ask questions here, too, of course.
Ok thanks.. I think I understand what I need to do but do you know where I can see an example of what the comment.php page might look like? I have this