ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

cant get javascript to work

August 26, 2011 4:14am

Subscribe [4]
  • #1 / Aug 26, 2011 4:14am

    Stefani Ann

    35 posts

    This question may be related to a resolved thread.

    I have another problem - I have uploaded all my javascript files to the root directory in a folder called “js” and in the head embde of my site, I have linked to these files like this:

    <!--[if lt IE 7.]>
    <scr*pt defer type="text/javascript" src="/js/pngfix.js"></scr*pt>
    <![endif]-->
    
    <!-- Jquery -->
    <scr*pt type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></scr*pt>
    
    <!-- Cufon Font Replacement -->
    <scr*pt type="text/javascript" src="/js/cufon.js"></scr*pt>
    <scr*pt type="text/javascript" src="/js/AvantGarde_Bk_BT_700.font.js"></scr*pt>
    
    <!-- Superfish Menu  -->
    <!-- <a href="http://users.tpg.com.au/j_birch/plugins/superfish/">http://users.tpg.com.au/j_birch/plugins/superfish/</a> -->
    <sc*pt type="text/javascript" src="/js/superfish.js"></scr*pt>
    
    <!-- Coin Slider Gallery -->
    <!-- <a href="http://workshop.rs/projects/coin-slider/--&gt">http://workshop.rs/projects/coin-slider/--&gt</a>;
    <sc*ipt type="text/javascript" src="/js/coin-slider.min.js"></scr*pt>
    
    <!-- Cycle Plugin -->
    <!-- <a href="http://jquery.malsup.com/cycle/--&gt">http://jquery.malsup.com/cycle/--&gt</a>;
    <sc*pt type="text/javascript" src="/js/cycle.js"></sc*pt>
    
    <!-- To customise any of the above, please use this file -->
    <sc*pt type="text/javascript" src="/js/inc.js"></sc*pt>


    But the javascript isnt working. I have tried many other ways of linking (site_url), taking out dashes, taking them out of the folders and putting them in the root, but still nothing. What am I doing wrong?

  • #2 / Aug 26, 2011 12:52pm

    Marcus Neto

    1005 posts

    Hi stephanie23,

    When you use inspect element in the browser of your choice does it show that the js is being brought in? If not then you may want to use the site_url variable to add the full path to the files. Relative paths can be a finicky thing.

  • #3 / Aug 27, 2011 10:35pm

    Stefani Ann

    35 posts

    Hi Marcus,

    I tried using the site_url in the link, but it makes no difference. When I inspect the code with firebug it shows that the code is running ( I think - I can see the script )...

    I am having the same trouble on another site (I am building two at the same time). I must be doing something wrong.

    Today I am trying to use a javascript image swap. Its just not working. Not sure where to go from here. Anything else I need to look out for?

  • #4 / Aug 29, 2011 1:24pm

    Kevin Smith

    4784 posts

    Hi Stephanie,

    It sounds like this is strictly a JS issue, which would be outside the scope of support we’re normally able to provide. If this gets too hairy, we may need to move this to Community Help, but we’ll try to help and get you pushed in the right direction in the meantime.

    When you say that JavaScript isn’t working, what do you mean exactly? Are you getting JS errors? Tell us in detail what you’re trying, what you expect to happen, and what happens instead.

  • #5 / Aug 31, 2011 9:54pm

    Stefani Ann

    35 posts

    Thanks, I applied site_url today and today it is working. Not sure what is different.
    Cheers

  • #6 / Sep 01, 2011 10:13pm

    Dan Decker

    7338 posts

    stephanie23,

    Sounds like you are all set then. Please start a new thread if you need assistance in the future.

    Cheers!

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases