jQuery on website not working, but working externally

Hiya there.

I have a website here, and the jquery is not working. On it’s external file here it [URL=“http://www.pricklypearmedia.com/clients/sitepoint/jquery_prickly/example_4.html”]works perfectly. The website is in WordPress so I am not sure if I have done something wrong. I tried the IRC channels but nobody seams to know what it is.

Can anybody shed light on this, spent all day on it.

Usually i see this happen when conflicting javascript or jquery. Also are the paths correct. I have seen some scripts not like having absolute paths. Also is this before wordpress jquery call ? There could be tons of reasons but without having access it is hard to tell from just looking at it.

It’s understandable that you need the files. I included the source code file for the major files associated with the homepage

page-home.php - http://pastebin.com/7Usf3FTb
header.php - http://pastebin.com/W7Mx6Zth
footer.php - http://pastebin.com/SpKUs1ic
functions.php - http://pastebin.com/4T6sAAvH

Since then I’ve tried a few tricks, including, using jQueries no conflict mode, which still not did not work - http://codex.wordpress.org/Function_Reference/wp_enqueue_script. I also used this, but no cigar -http://api.jquery.com/jQuery.noConflict/.

I know this is probably most likely due to inexperience. Since then I am looking more into jQuery and I am going to go through these tutorials so it can help me in the future. - http://net.tutsplus.com/articles/web-roundups/jquery-for-absolute-beginners-video-series/. My site is a WP site.

I hope this helps to try and figure out what’s up with the site.

I’ve taken a look a web site and the jQuery on there seems to be working fine with what you currently have there.
If the problem is being had with something else, please link us to a page that demonstrates the problem that you are having.

I went to your site and it has a maintenance pop up. Is everything working now ?

Sorry, I was working on an additional section to the site, so maintenance mode was up.

It’s now online again. I am still puzzled on what’s wrong with it and why it does not work. Somebody mentioned isolation mode in jQuery but that did nothing.

One thing i see real quick is the header.php is not correct you have

<?php wp_head();

without the ending tags.

it should be

<?php wp_head(); ?>

Also i would not put css in the header.

First of all, remove that noconflict part. It shouldn’t be used unless you understand what it’s used for and way.

Second, you have the jQuery library loading twice.
First it loads and then the sexy slider is loaded. Then you’re loading the jQuery library again for something else, which results in destroying that first one (and the sexyslider that attached itself on to the original jQuery).

remove my comment as Paul said same thing i did.

@mmoore5553;
@paul_wilkins;

The header region is okay, it’s done in PHP and echoing everything out instead. The CSS is there because of the slider. I don’t want it there and once I see things working I will remove it and try and put it in an external file.

I’ve updated the scripts now. I removed the no conflict part and also remove the additional call to the jQuery library, which is now being loaded through functions.php. I am not too sure I’ve everything is done, but it’s still broken.

The only thing that seems wrong now is that some of the slider init code has been inappropriately cut out.

Currently you have this:


 jQuery(document).ready(function() {
    $("#slider").SexySlider({
        ...
});

You are missing a part there from when closing off the slider init code.


 jQuery(document).ready(function() {
    $("#slider").SexySlider({
        ...
    [color="green"]});[/color]
});

okay, it’s done and now it seams to be working fine, thanks!

So to sum things up it was the missing end bit that did it for me and maybe the additional jQuery?

Let me know if there is anything else, because I will have to put my site back on maintenance mode to get working on the blog section, and also fixing up the appearance of the slider.

Good catch paul on the script part. I did not even bother looking at it.

I didn’t either until the other issues were resolved.
When the debugger claimed an unexpected end of input at line #1, that prompted a further investigation.

Step by step, resolving issues one by one. That’s how these things are solved.

Oh man, I got to get into jQuery more, thanks again Paul.