Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 156
  • Last Modified:

Why are my links not working?

Hi, I have function that creates a side menu with links for navigation but when I click on the links they don't do anything.  But if I right click and open in a new tab or copy the url and paste it in a new window it works fine.  Any suggestions??

http://auroriella.com/
function menu($select_menu, $select_product, $select_metal) {
	$menu_result = get_menu();
	$output = "";
	// These loops output the subject names with their corresponding pages underneath them
	while ($menu = mysql_fetch_array($menu_result)) {
		$output .= "<h3><a";
		if ($menu["id"] == $select_menu['id']) { // Makes the selected menu link bold
			$output .= " class=\"selected\"";
		}
		$output .= " href=\"" . $menu['menu_name'] . ".php?menu=" . urlencode($menu["id"]) . "\">{$menu["menu_name"]}</a></h3>";	// Builds the menu links
		$products_result = get_menu_products($menu["id"]);
		$output .= "<ul>";
		while ($product = mysql_fetch_array($products_result)) {
			$output .= "<li";
			if ($product["id"] == $select_product['id']) { // Makes the selected submenu link bold
				$output .= " class=\"selected\">";
			}
			else {
				$output .= ">";
			}
			$output .= "<a href=\"" . $product['name'] . ".php?product=" . urlencode($product["id"]) . "\">{$product["name"]}</a></li>";	// Builds the product links
			if($product["id"] == $select_product['id']) {
				$metals_result = get_metals();
				$output .= "<ul>";
				while ($metal = mysql_fetch_array($metals_result)) {
					$output .= "<li";
					if ($metal["id"] == $select_metal['id']) { // Makes the selected submenu link bold
						$output .= " class=\"selected\">";
					}
					else {
						$output .= ">";
					}
					$output .= "<a href=\"index.php?" . $metal["name"] . "-" . $product["name"] . "=" . urlencode($metal["id"]) . "\">{$metal["name"]}</a></li>";	// Builds the metal links
				}
				$output .= "</ul>";
			}
		}
		$output .= "</ul>";
	}
	return $output;
}

Open in new window

0
FairyBusiness
Asked:
FairyBusiness
1 Solution
 
dnzone88Commented:
Can you disable the jquery code below in your action.js. I think the problem is caused by this e.preventDefault();

$('#sideBar > ul > li > a').click(function(e) {
    e.preventDefault();
    $('#metals').show();

});

Open in new window

0
 
FairyBusinessAuthor Commented:
Geez, I totally forgot that I did that!  Thanks  :)
0

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now