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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T01:15:49+00:00 2026-06-11T01:15:49+00:00

I do not see where my error is, If there is any <!DOCTYPE html>

  • 0

I do not see where my error is, If there is any

<!DOCTYPE html> <html> <head>
        <script type="text/javascript">
            //http://stackoverflow.com/questions/10251149/using-javascript-to-detect-google-chrome-to-switch-css
            //provera brosera
            function check_chrome_ua() {
                var ua = navigator.userAgent.toLowerCase();
                var is_chrome = /chrome/.test(ua);
                alert("func check_chrome_ua() " + is_chrome);
                return is_chrome;
            }
            //promena nadpisa
            function check() {
                //alert("check1");

                var check = check_chrome_ua();
                alert("var check " + check + "; func check_chrome_ua() " + check_chrome_ua());

                if (check == "false") {
                    alert("change text");
                    document.getElementById("opomena").style.color = "red";
                    document.getElementById("opomena").innerHTML = 'Warning you are not using Google Chrome';
                }
            }
        </script>
        </head>
        <body onmousemove="check()">
    <div id="opomena">Thank you for using Google Chrome.</div>

</body>
 </html>

Popups on Google Chrome popup says true, on Firefox says false
popup “change text” does not display in Firefox tho var check is false.

Thank you in advance for advice

  • 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-06-11T01:15:51+00:00Added an answer on June 11, 2026 at 1:15 am

    Change

    if (check == "false") {
    

    to

    if (!check) {
    

    or

    if (check == false) {
    

    if you really want to check for the boolean value, false.

    The regexp, test method which you call at /chrome/.test(ua) returns a boolean, but check == "false" is comparing that boolean to a string. The two are not equal.

    In JavaScript, == is permissive when it comes to comparing strings to objects, but not as permissive as Perl’s eq operator.

    • 0 == false
    • false == false
    • "false" == [false]
    • false != "false"
    • 0 != "false"

    It’s a good habit to try and use !== and === which are well-defined operators to compare primitive values.

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

Sidebar

Related Questions

Maybe the worst type of error message that one can see. Does not mean
Copied from my log file ActionView::Template::Error (Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs
This part of the code is fine i do not see any problem there
The following code does not want to compile. See the included error message. Code:
The problem is that the Eclipse compiler do not see any layout or ids,
While I do not see any functionally or jquery UI elements affected by this,
Is there any way to catch a controller not found event from the framework?
I see there is a lot of similar questions but passing through them not
I want to insert some datas to sqlite manager. There is any error message
What's the reason for typedefs not being strongly typed? Is there any benefit I

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.