Results 1 to 10 of 10

Thread: Browser Compatibility problems ..Hide function of javscript

  1. #1
    Join Date
    Jul 2012
    Posts
    197
    Thanks
    55
    Thanked 3 Times in 3 Posts

    Default Browser Compatibility problems ..Hide function of javscript

    Hide() function in Js is not working in IE ?
    Which is the other function available parallel to this hide(); with cross browser supporting

    Iam complicated about thinking some functions of Js are working in some browsers but not at all..

    Really which are js functions support for all browsers ? how can we apply a logic/solution to avoid browser compatibility problems of Javascript ?

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    29,070
    Thanks
    44
    Thanked 3,216 Times in 3,178 Posts
    Blog Entries
    12

    Default

    hide() is not a js function. Are you using jQuery? If so, jQuery's .hide() does work in IE 7. However, depending upon how you use it in that browser, it might not. Older browsers are generally trickier to work with even in something like jQuery which tends to normalize differences.

    If hide() is a function you wrote in regular javascript or copied from somewhere else where it was written in regular javascript, it may or may not have what it takes to work in IE 7. From what you're saying it doesn't, at least not the way you're using it.

    In any case, if you want more help, please include a link to the page on your site that contains the problematic code so we can check it out.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Jul 2012
    Posts
    197
    Thanks
    55
    Thanked 3 Times in 3 Posts

    Default

    Thanks MR. John

    No i am not using jquery

    That means if we are using jquery and use hide(), show() that will work in all browsers including all versions of IE, Chrome, Opera, Safari, Mozilla etc etc ......(ALL). Then there will no problem arise for browser incompatibility ?

    what is the term of the license for jquery ? Is any prblem arise if we use this type of third party applications ?

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    29,070
    Thanks
    44
    Thanked 3,216 Times in 3,178 Posts
    Blog Entries
    12

    Default

    jQuery supports IE 6 and later. However, if it's something a particular IE browser just cannot do, you may need to make your own routine for it for that browser to substitute another similar effect or make sure your code degrades gracefully in that browser. In some cases you must make sure you're working with valid HTML and/or have set any required prerequisite css on the element you're working on. Said css may not be required in newer more compliant browsers.

    jQuery also supports all current versions of browsers, and most past ones that are still in use, even some that aren't.

    jQuery is free for use by all under an MIT style license. Its .hide() and .show() functions are pretty straightforward. As long as they are used with the proper syntax, on valid markup, you should be fine.

    There's extensive searchable online documentation:

    http://api.jquery.com/

    And the code itself is hosted on Google's servers so you can use that. The latest version is generally:

    Code:
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
    If you put that in the head of your page before any code that uses jQuery you will have the latest version.

    That's usually but not always the best version to use. Google hosts virtually all the versions, so you can specify a sub version or even a sub sub version:

    Code:
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. The Following User Says Thank You to jscheuer1 For This Useful Post:

    letom (02-12-2013)

  6. #5
    Join Date
    Jul 2012
    Posts
    197
    Thanks
    55
    Thanked 3 Times in 3 Posts

    Default

    Dear John

    Thanks for your valuable advices. You have any suggestion for my following question ?

    Testing a Web Application in all browsers are very difficult. Exactly we don't know how many browsers are existing in cyber world. Or other wise testing application in these 1000 browsers in real sense it is totally impossible.

    Then what is a solution to check the output of javascripts in a single browser ? Like Mozilla .. that same result we got in Mozilla, should be produced when accessing from all other browsers.

  7. #6
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    29,070
    Thanks
    44
    Thanked 3,216 Times in 3,178 Posts
    Blog Entries
    12

    Default

    Right now Chrome and IE are the two most used browsers and their market share is about even with Chrome slowly (or quickly, depending upon who you believe) overtaking IE. Mozilla's share is shrinking and was never more than a threat to IE's dominance. Not like Chrome, which is (or at least was last I checked) overtaking IE. Of older versions of IE Only IE 8 and up are used much these days.

    So I would say check in IE 8, 9, and 10, and Chrome (latest version, they're real good about keeping their product up to date on all computers) at least. I'd throw in Mozilla Firefox because a lot of folks still use that. Other than those, it's just up to you about whether or not you want to support IE 7 or 6, or Opera, or any other browser. Opera and others (not earlier IE) will generally work if those 5 (including Firefox) listed above work, though there can be exceptions. IE 7 and less must be checked individually if they're important to you. An experienced coder can generally know which sort of things might trip up early IE, but no one can tell for sure without checking.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  8. The Following User Says Thank You to jscheuer1 For This Useful Post:

    letom (02-13-2013)

  9. #7
    Join Date
    Jul 2012
    Posts
    197
    Thanks
    55
    Thanked 3 Times in 3 Posts

    Default

    Thanks

    Is there any JavaScript or PHP coding available for the following ?

    If the Browser of the Visitor is (IE- 8,9 10) || (G-Chrome-latest 2 versions) || (Mozilla latest 2 versions) || (Safari latest 2 versions)

    {
    Continue the access for website
    }

    else

    {
    Your Browser is not supported by our website / You need IE, G-chrome, mozilla or safari to continue the access..
    }

    adding above restriction is good in cyber world ?

  10. #8
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    29,070
    Thanks
    44
    Thanked 3,216 Times in 3,178 Posts
    Blog Entries
    12

    Default

    There's no practical way, perhaps no way to know the latest two versions of those browsers. They update too frequently. You could settle for the current version and higher, in which case it could be done.

    However, of the very few people using outdated browsers, most are doing it either for diagnostic purposes or they are at least aware that their browser is outdated and expect the occasional rendering and script problems.

    Chrome updates automatically in the background unless you change its default settings. If you update your computer at all, IE 6 and 7 will be replaced by IE 8 unless you specifically tell the updater not to. If you do, you will be warned that this is an important performance and security update. I don't know Safari's update policy. Firefox (which is different than Mozilla, there are a number of Mozilla based browsers aside from Firefox) is pretty aggressive in keeping it's installed browsers updated. You have to specifically tell it not to update and will be warned that it's unwise not to update.

    Many browsers that are not these browsers will do just fine as long as the page performs well in these browsers, and the number of people using these other browsers is very small and they are usually aware of any problems that are common to their browser and know ways of dealing with them.

    In light of that, the answer to your question would have to be "no". If someone has another browser, they should at least be allowed to try viewing your pages. You can have something hard coded into the index page perhaps, like:

    HTML Code:
    <div>Best viewed in Chrome.</div>
    But other than that, you should let people do whatever they want to or need to - some people just can't run anything better than what they have due to the age of their hardware, and/or due to physical handicaps like blindness, etc. And your page should 'work' if all styles, and/or all images, and/or all javascript are turned off or missing. It doesn't have to pretty like that, but the essential information and links on it should still be accessible.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  11. The Following User Says Thank You to jscheuer1 For This Useful Post:

    letom (02-14-2013)

  12. #9
    Join Date
    Jul 2012
    Posts
    197
    Thanks
    55
    Thanked 3 Times in 3 Posts

    Default

    Thanks Jo .. Highly informative

    One more Question what is the difference between

    From Jquery.com

    <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
    <script src="http://code.jquery.com/jquery-migrate-1.1.0.min.js"></script>

    &

    From the Link you had given

    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
    Last edited by letom; 02-14-2013 at 03:40 AM.

  13. #10
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    29,070
    Thanks
    44
    Thanked 3,216 Times in 3,178 Posts
    Blog Entries
    12

    Default

    What you are calling the link I gave is actually two possible links you can use. Don't use both at once. Of the two I gave, the first will give you the latest release version in the jQuery 1 series (currently 1.9.1, but if 1.9.2 comes out, it will automatically switch to that). There is no 2 series - yet. The second one will give version 1.8.3, which was the last and best of the 1.8 series.

    What you have is series 1, sub version 9, sub, sub version 1 (as already noted, currently the most recent release, but in this case, if 1.9.2 comes out, it will still only be 1.9.1) and a script (migrate) that allows it to handle code written for some earlier versions of jQuery (1.9.1 eliminates several common jQuery syntaxes that had been deprecated but not removed in prior versions).

    Another difference between what you have and what I supplied is the host. The two scripts you list are on jQuery's jquery domain, The two I offered are on Google's ajax.googleapis domain. The actual code would be the same though, as long as you're accessing the same version. Additionally I don't believe Google is hosting the migrate script. And, so far as I know, only Google allows partial version numbers with automatic updating to the most recent sub and/or sub, sub version.

    So essentially there's little practical difference. The concept involved is that instead of hosting the jQuery library yourself (which you can do if you like), you are using a copy of it hosted on another server. The main advantage in doing so is that it may already be cached on the user's computer. So as long as the third party host (jQuery's or Google's in these cases) is up and running, your page will in many cases load faster.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  14. The Following User Says Thank You to jscheuer1 For This Useful Post:

    letom (02-15-2013)

Similar Threads

  1. CSS cross browser compatibility
    By alphavee in forum CSS
    Replies: 1
    Last Post: 05-03-2012, 11:09 PM
  2. browser compatibility
    By gul in forum JavaScript
    Replies: 1
    Last Post: 10-20-2010, 04:34 PM
  3. Replies: 1
    Last Post: 11-03-2009, 03:13 AM
  4. Compatibility Problems- Help!
    By rmagnes in forum CSS
    Replies: 4
    Last Post: 05-09-2007, 06:04 PM
  5. browser compatibility
    By deepakdeep in forum Dynamic Drive scripts help
    Replies: 1
    Last Post: 08-18-2006, 02:57 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •