• Resolved daft02

    (@daft02)


    hi,
    i have try everything , never had problem with it but now i just can’t make jquery work, any thoughts what i can do to troubleshoot it?

Viewing 8 replies - 1 through 8 (of 8 total)
  • is javascript enabled for your browser?

    Thread Starter daft02

    (@daft02)

    yes it is.
    edit: i tested the javascript and it works but not jquery

    Thread Starter daft02

    (@daft02)

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="https://www.w3.org/1999/xhtml" <?php language_attributes(); ?> >
    
    <head profile="https://gmpg.org/xfn/11">
    <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>"/>
    
    <title></title>
    
    <meta name="generator" content="WordPress <?php bloginfo('version'); ?>" />
    <meta name="robots" content="index,follow" />
    
    <link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS Feed" href="<?php bloginfo('rss2_url'); ?>" />
    <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
    
    <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
    <link rel="stylesheet" href="jqueryslidemenu.css" type="text/css" />
    
    <!--<script type="text/javascript" src="<?php bloginfo('template_url'); ?>/js/jquery-1.3.2.min.js"></script> -->
    
    <script type="text/javascript" src="jquery-1.3.2.min.js"></script>
    
    <!--<script type="text/javascript" src="ajax_flash_tabs.js"></script>-->
    
    <script language="JavaScript" type="text/javascript">
    
    jQuery(document).ready(function(){
    /*flash_01();*/
    /*jQuery("#container").load("flash_01.htm"); */
    
    /*jQuery("div#adbox a.tab_link:first").addClass('active');
    
    jQuery("div#adbox a.tab_link").click(function(){
    jQuery(this).addClass('active').siblings().removeClass('active').siblings("container");
    jQuery(this).next("div.container").show().siblings("div.container").hide();
    })*/
    
    jQuery('div#6').cycle({
        fx:     'scrollDown',
        timeout: 1000,
        pause:   1
     });
    
    alert("jkj");
    
    });
    
    </script>
    
    <?php wp_head(); ?>
    
    </head>

    this is the head part in header.php, i know the way i call js it’s not the most conventional way but it ahs always work for me this way, i also called jquery by using <?php bloginfo(‘template_url’) but it neither worked(it is commented)

    Is jquery included in your page, does the jquery script get included in your page, if you check via view source…

    Do you have any other scripts that may conflict, have you tried removing them..

    “Tried everything” gives no indication of what you have tried though, so would be a good place to start…

    List what you’ve tried, “everything” doesn’t help..

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.remarpro.com Admin

    Could you define what exactly you mean by “does not work”?

    What is not working about it? How do you test whether it is working or not?

    Thread Starter daft02

    (@daft02)

    i have tried alert(“khjkh”) and it works in javascript , but not with jquery(inside document ready function)

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.remarpro.com Admin

    Looking at the code you posted above, you must put the jQuery code after the call to wp_head().

    The jQuery script is not included until wp_head executes. So anything before that won’t know what jQuery is.

    Also, jQuery must be included using wp_enqueue_script(‘jquery’) before the wp_head() call.

    Also, you’re trying to use an explicit script declaration to the jquery-1.3.2.min.js file, which won’t work because it won’t fit into your permalink structure.

    Basically, you need to do this:

    <?php wp_enqueue_script('jquery'); ?>
    <?php wp_head(); ?>
    <script language="JavaScript" type="text/javascript">
    jQuery(document).ready(function(){
    whatever
    });
    </script>

    Thread Starter daft02

    (@daft02)

    thank you otto42 i put the <?php wp_head(); ?> before jquery and now it works, funny thing is all of my precedent blog have the <?php wp_head(); ?> after jquery and jquery works.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘jquery does not work in my blog’ is closed to new replies.