I make up a simple HTML and CSS website. Everything works, but when the script is connected:


<script type="text/javascript"> $(document).ready(function(){ $('a').on('click', function(e){ e.preventDefault(); }); $('#ddmenu li').hover(function () { clearTimeout($.data(this,'timer')); $('ul',this).stop(true,true).slideDown(200); }, function () { $.data(this,'timer', setTimeout($.proxy(function() { $('ul',this).stop(true,true).slideUp(200); }, this), 100)); }); }); </script> 

All links on the page stop working, although the mouse pointer displays them as links, but does not open. Only by clicking the right mouse button -> "open in a new tab"
What could be the problem? Tomorrow deadline, I have been thinking about the problem for 3 days, I hope for help.

    2 answers 2

    So you yourself preventDefault done ... This means that the links will not be processed in the usual way.

      As already mentioned, this part of the script does not allow the browser to handle links.

        $('a').on('click', function(e){ e.preventDefault(); }); 

      If you remove it, then everything will work.