Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6660499
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:09:46+00:00 2026-05-26T02:09:46+00:00

This script is working perfectly with Chrome and Safari, but Firefox is bugging up

  • 0

This script is working perfectly with Chrome and Safari, but Firefox is bugging up for some reason:

<script type="text/javascript">
var $j = jQuery.noConflict();

$j(document).ready(function(){

    $j(function(){
        $j('.next').click(function() {
            location.href = $j(this).attr('href');
        });
        $j('.prev').click(function(){
            location.href = $j(this).attr('href');
        });

    });

    $j('body').keydown(function(event) {
        if(event.keyCode==82) {
            $j(document).trigger(location.href = '/?random');
        }
        if(event.keyCode==39) {
            $j('.next').trigger('click');
        }
        if(event.keyCode==37) {
            $j('.prev').trigger('click');
        }
    });

    $j('input, textarea').keydown(function(){
        event.stopPropagation();
    });

});
</script>

If you press left or right on your keyboard, it takes you to the next/prev page. If you hit R, it takes you to a random page. HOWEVER, if you are typing something in an input or textarea, the keyboard navigation is turned off (so the you can type without an unexpected page load if you hit R, left, or right).

It works great in Chrome and Safari, but in Firefox it bugs and the keyboard nav instead ONLY works if you’re typing in an input or textarea. It does the opposite of what is intended.

I’ve disabled all add-ons in Firefox which didn’t help. There have been a couple random times when it has worked properly, but I can’t replicate them. I’m stumped as to why this isn’t working in Firefox… any ideas? Thanks so much in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T02:09:47+00:00Added an answer on May 26, 2026 at 2:09 am

    You seem to be missing the event parameter in your function:

    $j('input, textarea').keydown(function(){
        event.stopPropagation();
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

my script is not working on chrome but working perfectly on firefox script is
So I had this working perfectly fine, but now for some reason I can't
ok, this code works just fine in Chrome. But, for some reason it does
I'm trying to get this simple PowerShell script working, but I think something is
My site is loading up perfectly in Firefox, Chrome and other browsers like Safari
I'm working on a Python script that transforms this: foo bar Into this: [[Component
I am working on a Bash shell script that does something like this: #!/bin/bash
I'm using this script to display all the images in a folder, but I
I have a script that I use in many sites. It's working perfectly except
I have a problem with this script : click here . Currently it's working

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.