I have experimented with jQuery a while ago and it worked kinda neat. Now I created a site in php, with included header, footer, sidebar, you name it.
However, the jQuery doesn’t seem to work AT ALL. I linked to the jquery file which I downloaded to my hard drive. I’m currently running this site on localhost (xampp).
Since none of the jQuery code is working (and I’m trying really basic stuff like a click handler to pop up an alert – just to make sure jQuery works) I was wondering if the DOM gets processed first and then the included PHP files.
Any help is appreciated, I just want some simple jQuery running on the site.
Thanks
EDIT: sample code
$('document').ready(function() {
$("#header-photo").click(function() {
alert("Handler for .click() called.");
});
});
Linking the jQuery file:
<script src="jquery.js"></script>
It’s in the same folder.
try to use it this way:
first ref to the jquery plugin:
try this and see if this works.