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 3609876
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T21:40:58+00:00 2026-05-18T21:40:58+00:00

I made some javascript code for my website, it works without problem on opera

  • 0

I made some javascript code for my website, it works without problem on opera and chrome, but not on firefox.

Here is script:

function checkstate(who,row,cell)   {
    var zwrot="";
    var mouseEvent='onmouseover="javascript:bubelon(this.id);" onmouseout="bubeloff();"';
    var cellid="";

    ajax=new XMLHttpRequest();
    ajax.onreadystatechange=function(aEvt) {
        if (ajax.readyState===4 && ajax.status===200) {
            alert("im here!");
            }
    };

    ajax.open('GET',"oth/work_prac_stan.php?usr="+who,false);
    ajax.send();
}

function sprawdzstan() {
    var lol="";
    var table = document.getElementById("usery");
    var re = /^<a\shref\=/g;

    for (var i = 1, row; row = table.rows[i]; i ++) {
        if (row.cells[0].innerHTML.match(re)) {
            checkstate(row.cells[1].innerHTML,row,2);
        } else {
            checkstate(row.cells[0].innerHTML,row,1);
        }
    }
}

The problem is, that firefox is not running function assigned to onreadystatechange. I checked in firebug, that response from php file is correct.

Where is the problem? It works on chrome and opera, firefox just dont, no error in console, nothing.

  • 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-18T21:40:58+00:00Added an answer on May 18, 2026 at 9:40 pm

    Updated answer

    According to Mozilla’s docs, you don’t use onreadystatechange with synchronous requests. Which kind of makes sense, since the request doesn’t return until the ready state is 4 (completed), though I probably wouldn’t have designed it that way.

    Original answer

    Not immediately seeing a smoking gun, but: Your ajax variable is not defined within the function, and so you’re almost certainly overwriting it on every iteration of the loop in sprawdzstan. Whether that’s a problem remains to be seen, since you’re using a synchronous ajax call. In any case, add a var ajax; to checkstate to ensure that you’re not falling prey to the Horror of Implicit Globals.


    Off-topic: If you can possibly find a way to refactor your design to not use a synchronous ajax request, strongly recommend doing that. Synchronous requests lock up the UI of the browser (to a greater or lesser degree depending on the browser, but many — most? — completely lock up, including other unrelated tabs). It’s almost always possible to refactor and use an asynchronous request instead.

    Off-topic 2: You aren’t using mouseEvent in your code, but if you were, you would want to get rid of those javascript: prefixes on the onmouseover and onmouseout attributes. Those attributes are not URLs, the prefix is not (there) a protocol specifier (it’s a label, which you’re not using).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I made a website that depends on PHP, AJAX and Javascript. The problem here
I have made some code which exports some details of a journal article to
I'm trying to write some JavaScript for my website that will select all the
I've made some unit tests (in test class). The tutorial I've read said that
So I made some timers for a quiz. The thing is, I just realized
I had made some questions regarding PHP-GTK (there are only 4 php-gtk tagged questions
I have a ASP.net 2.0 app and I have made some changes the the
I've created a custom list, and made some changes to the way the CQWP
So a webapp I've been working on broke, and I made some fixes... it
I made a discovery some time back. Just follow these steps: Create a .doc/.xls/.ppt

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.