So i am trying to redirect users from the homepage to the forums with a keyboard event, This is the current code that does not seem to be working:
$(document).ready(function(){
$("body").keydown(function(e){
var key = e.keyCode;
if (key == 13){
window.location.href = "forums";
}
});
});
The homepage is on the site root, as well as the forums folder.
The console is clean, no errors, no alerts...
All suggestions and comments are more than welcome and appreciated! Thanks!
Is forum an HTML File?
If yes, it would be important to add the extension or the complete path.
/views/Forums/forums.html
Also, make sure that, if you use the different numeral values for the key, to be sure that the number is the one you are really looking for. You can find a list of the values here.
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다