I would like to redirect to another page using jQuery code. This is my event declaration:
<script> $(function () { var menu = $("#menu").kendoMenu({ dataSource: [ { text: "EMSS", cssClass: "emss" } ] }).css({ width: "100%" }).data("kendoMenu"); //event declaration $("li.emss").click(redirectToPage); }); function redirectToPage(url) { window.location.ref = url; } </script>
<div id="menu" style="margin-right:0px;"></div>
How do I pass the page I would like to redirect to to the function? Or how can I do this in any other way?
Btw, I'm trying to redirect to an MVC page.
Just pass the argument to the function in the click handler
$("li.emss").click(function(){
redirectToPage('my url');
});
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.