The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Can’t get simple jQuery working in WP

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #29815

    Trying to use Fancybox jQuery to load up URLs in an iFrame, not the actual WP Fancybox plugin. I got the code from and when I load it outside of my theme folder it works fine. When I copy the exact code into my Header as below and link to the JS files it loads Google in the full page as opposed to loading up Google in the fancybox. Tried everything, really need some guidance please…


    <?php wp_title('«', true, 'right'); ?> <?php bloginfo('name'); ?>

    This is the link I use to test it out


    I have a jQuery contact form on the same page and that works fine. I stripped that out to avois any conflicts, also didn’t work. If I put the index.html file that comes with fancybox into my wordpress folder it works great, but when i copy the code across it didn’t. Thought it might be my theme so tried it in default and another theme and still no luck.

    Any help would be much appreciated.

    <?php wp_enqueue_script("jquery"); ?>
    <script type=’text/javascript’ src=’’></script&gt; <!– jQuery –>

    That looks like you would be loading 2 jQuery scripts. Check in the source once the page has loaded. If so, remove one of them.

    Try removing ‘$j=jQuery.noConflict();’ and see what happens. So the javascript should look like this.

    <script type="text/javascript">
    $(document).ready(function() {

    ‘width’ : ‘75%’,
    ‘height’ : ‘75%’,
    ‘autoScale’ : false,
    ‘transitionIn’ : ‘none’,
    ‘transitionOut’ : ‘none’,
    ‘type’ : ‘iframe’


Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.