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

  • SEARCH
  • Home
  • 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 1062857
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T18:41:39+00:00 2026-05-16T18:41:39+00:00

I know that there is a difference between ff and ie regarding the attribute

  • 0

I know that there is a difference between ff and ie regarding the attribute ‘class’.

I want to put in the global.js something like that:

function GetVarByBrowser()
{
  if (navigator.appName == 'Microsoft Internet Explorer')
  {
    var getClass= 'className';
  }
  else
  {
    var getClass= 'class';
  }

}

and in the page i added this:

ElementServer.setAttribute(GetVarByBrowser(), 'server');

how can i make it works?

  • 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-16T18:41:40+00:00Added an answer on May 16, 2026 at 6:41 pm

    No need for global variables. Have the function return the value instead:

    function GetVarByBrowser()
    {
      if (navigator.appName == 'Microsoft Internet Explorer')
      {
        return 'className';
      }
      else
      {
        return 'class';
      }
    
    }
    

    However, this is an imperfect method of browser detection for a number of reasons. Have you considered using a library like jQuery that takes care of quirks like this automatically? Or do you want to learn this yourself (which is perfectly fine and commendable)?

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

Sidebar

Related Questions

Is there a runtime performance differance between public and private variables/methods? I know that
I know the difference between Sax and Dom is pretty substantial regarding parsing Xml,
I'm really confused. I want to do something that a) seems like it should
Regarding performance, is there any difference between doing: $message = The request $request has
I know that there must be some differences. I have a Silverlight component (
I know that there are 3 different binding contexts or load contexts: Load LoadFrom
I know that there are many different questions about this sort of topic on
I know that there are some threads have a similar issue with this thread.
I know that there are lot's of questons on this, but all seem to
I know that there are others posts with solutions on the site but 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.