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

Home Forums JavaScript Not loading external .js file

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

    I’m working on a simple unordered list style menu within a <div id="top_nav">. Where I’m running into an issue is within the head, I call to reference

    <script src="; type="text/javascript"></script>

    then underneath reference a secondary .js file

    <script src="scripts/nav_delay/nav_delay.js" type="text/javascipt"></script>

    then when I preview the file the desired js. effect does not work. BUT..

    When I substitute the secondary .js reference for;

    <script language="javascript">
    var timeout = 900;
    var closetimer = 0;
    var ddmenuitem = 0;

    function top_nav_open()
    { top_nav_canceltimer();
    ddmenuitem = $(this).find(‘ul’).css(‘visibility’, ‘visible’);}

    function top_nav_close()
    { if(ddmenuitem) ddmenuitem.css(‘visibility’, ‘hidden’);}

    function top_nav_timer()
    { closetimer = window.setTimeout(top_nav_close, timeout);}

    function top_nav_canceltimer()
    { if(closetimer)
    { window.clearTimeout(closetimer);
    closetimer = null;}}

    { $(‘#top_nav > li’).bind(‘mouseover’, top_nav_open)
    $(‘#top_nav > li’).bind(‘mouseout’, top_nav_timer)});

    document.onclick = top_nav_close;

    and embed it directly withing the page, it runs fine. I’ve tried with both relative and absolute file paths, too.. but still nada.

    Does anyone have any ideas?

    Thanks in advance.


    I’m pretty sure it’s because you are giving an incorrect path. Do you have a working link?

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