I have a single menu bar. I recently discovered an interesting way to make the entire menu bar area clickable using jQuery.
Design code snippet:
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="MenuControl.ascx.cs" Inherits="MenuControl"%>
<link rel="stylesheet" href="css/Menu3.css" type="text/css" />
<div id="header" align="center">
<script type="text/javascript" language="javascript">
$(document).ready(function() {
$(".Menu").click(function(e) {
window.location = $(e.target).find("a").attr("href");
return false;
});
});
</script>
<table width="100%" cellpadding ="0" cellspacing ="0" align="center">
<tr>
....(The remaining code is omitted)....
However, when I click on the original menu item, it throws an error like:
Server Error in '/EasyWeb' Application.
--------------------------------------------------------------------------------
The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
Requested URL: /EasyWeb/undefined
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053
Is there an issue with my jQuery code??
------------------------------------Updated-----------------------------------------
Here is the full HTML markup:
<table width="100%" cellpadding ="0" cellspacing ="0" align="center">
.....(The remaining code is omitted)......