WordPress.org

Ready to get started?Download WordPress

Forums

Easy FancyBox
JS error: Uncaught TypeError: Property 'undefined' of object # is (8 posts)

  1. raspberryh
    Member
    Posted 2 years ago #

    Hi,

    I am trying to use FancyBox with an iframe on my site, and I keep getting this error:
    Uncaught TypeError: Property 'undefined' of object #<Object> is not a function

    The page is:
    http://client.acropolisinc.com/ny5000/galleries/

    and it happens when you click on the New York thumbnail (goes to an iframe).

    I tried deactivating plugins, except there were a couple that I tried to deactivate but when I did, it showed the site as broken... those are "Dropdown Menu Widget" and "Advanced Custom Fields". So because of this I can't really tell if it's a conflict with these plugins.

    What should I do?

    Thanks so much!
    Heather

    http://wordpress.org/extend/plugins/easy-fancybox/

  2. RavanH
    Member
    Plugin Author

    Posted 2 years ago #

    Several conflicts going on there at once... More than one jQuery library included, more than one lightbox script. Possibly more.

  3. raspberryh
    Member
    Posted 2 years ago #

    Hey, thanks for the reply! Well I did end up getting it to work - in the nggallery, I changed it to use thickbox, then I used the thickbox stuff to display my video.

    BUT, I have a question, well I'm pretty n00b to WP... So just in general, how do you avoid these types of conflicts? It always seems like the easiest way to implement special features is to install plugins... but then all the code ends up conflicting! So, how do you usually work around that? Do you just try to install less plugins? What is your strategy? :)

    Thanks!
    Heather

  4. raspberryh
    Member
    Posted 2 years ago #

    Hey, I know you guys hate this kind of thing (from looking at past posts) but I was wondering if you could delete the website link I posted? I figured I'd be able to just edit it out later but I didn't realize that we can't edit our forum posts after a set amount of time :( I just found out now from looking through the other forum posts :(

    Next time I will create a url using a url shortener and then later I can change it to 404! Wish I had known about this and come up with the idea before. :-/

  5. Samuel Wood (Otto)
    Tech Ninja
    Posted 2 years ago #

    No, we won't delete the website link you posted, and if you had used a URL shortener, we would de-shorten the link instead. The link provides valuable information showcasing the problem and the potential solution and it can be helpful for others later.

    If you're here to get answers to your problems only, then you're in the wrong place. This is a forum and a resource for people trying to both find and give help to others. Archives of problems and solutions are valuable for all people, and retroactively changing things doesn't help anybody but yourself, and even then it rarely helps you to do so.

    Nobody really cares that you had an issue and got it solved. You're overthinking it.

  6. raspberryh
    Member
    Posted 2 years ago #

    Wow. Different than ya'lls replies to others in the past. FYI, I really don't think the link would be helpful in the future since by that time I would have solved the problem anyways... In addition, I wrote what my solution was anyways. But whatever, you're the boss.

  7. RavanH
    Member
    Plugin Author

    Posted 2 years ago #

    Hi Heather,

    Conflicts between plugins are up to individual developers to avoid. As much as possible, anyway. That's a downside of a large open community like this, there is no guarantee that different plugins are compatible or even tested in combination.

    So yes, keeping the number of plugins limited will help :) ... Of course, it will also keep site speed at a decent level as some plugins tend to eat a lot of resources. While others are designed to improve site performance.

    I can imagine it seems like a dense forest but since you are already quite active on these forums, you will probably have some clues about how to spot valuable and well kept plugins and how to avoid the lesser ones ;)

    In any case, another important factor in reducing conflicts is the theme. Thanks to not deleting the link I could take another peek ( ;) ) and beside the fact that it looks fantastic, there are some improvements that can be made: there seem to be many script files (starting with jquery.min.js) included by 'hard code' in the footer.php template. This is asking for conflicts because this way, WordPress has no way of knowing what scripts have been loaded already and so no way to prevent doppelgängers.

    Basically, what needs to be done is remove these hard-coded lines and move the inclusion of scripts to functions.php, using wp_enqueue_script. Start with reading http://codex.wordpress.org/Function_Reference/wp_enqueue_script (you can find some great tutorials in the Resources list at the bottom too)

    Note that it is the $handle that WordPress uses to detect double inclusions so be careful in choosing the correct handle name. There is a list on that same Codex page of scripts that come with WordPress with their correct handle name. Other scripts you'll have to name yourself but here are some tips:
    jquery.mousewheel.js should use the handle 'jquery-mousewheel' (use hyphens)
    jquery.jscrollpane.min.js should use the handle 'jquery-jscrollpane' (ignore min)
    engine.js does not matter how it is called since it is theme specific javascript code and not a library... Still it might cause conflict, though!

    Good luck :)
    Allard

  8. raspberryh
    Member
    Posted 2 years ago #

    Allard,

    Wow, thank you so much for the helpful response!! I will definitely check that out :) :) I inherited this site btw and am new to wordpress and had no idea about how to avoid the double-inclusions. Thanks again!!!

    Heather

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic