I have one javascript function that used to display the menu and content in my web page. This is how I call this function :
$(document).ready(function () {
ViewProduct(action_name);
});
So after my page load ready, It will call to this function. But the problem is, I have a search text box used to view the product that the user want to search.
function SearchClick() {
if (typeof select_cat != 'undefined' && typeof select_dep != 'undefined') {
action_name = "GetProductByCatSearch";
}else if (typeof select_dep != 'undefined'){
action_name = "GetProductByDepSearch";
}else{
action_name = "GetProductBySearch";
}
ViewProduct(action_name);
}
So when the SearchClick() is called, it produce the menu and product again. Then there are duplicate menu and content.
what I want is to skip the function in document.ready, when the function in SearchClick() is called.
Welcome to all solutions. Thanks so much.
What you should do is empty the menu first in the
ViewProductfunction. Function already executed can not be skipped.