- This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
Viewing 2 posts - 1 through 2 (of 2 total)
- The forum ‘JavaScript’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Home › Forums › JavaScript › Not loading external .js file
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
then underneath reference a secondary .js file
then when I preview the file the desired js. effect does not work. BUT..
When I substitute the secondary .js reference for;
function top_nav_open()
{ top_nav_canceltimer();
top_nav_close();
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;}}
$(document).ready(function()
{ $(‘#top_nav > li’).bind(‘mouseover’, top_nav_open)
$(‘#top_nav > li’).bind(‘mouseout’, top_nav_timer)});
document.onclick = top_nav_close;
</script>
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? http://css-plus.com/2010/03/6-steps-to-take-if-your-jquery-is-not-working/