Results 1 to 4 of 4

Thread: some Javascript files only recognize in IE and not in others

  1. #1
    Join Date
    Jan 2009
    Posts
    124

    some Javascript files only recognize in IE and not in others

    I have some Javascript file, I found that these file works only with some of the web browser and not with all the browsers such as it is recognized or opens fine with the IE and when i try to open in the Firefox its cross hair remains searching, how this has to be sort out. what do i do so that it will get compatible with the other browsers as well, Please help

  2. #2
    Join Date
    Oct 2008
    Posts
    167

    Re: some Javascript files only recognize in IE and not in others

    It's best to use object detection to accomplish what you need, or use conditional comments. But if you need to detect IE6, Instead of testing in IE, to save time (single programmer not all that skilled) I'd like to just put in a script in my first included file that test for browser and if not firefox or safari. or to target any one of the IE version on there own is quite simple, add the version number to the expression above, e.g. <!--[If IE 6]> HTML <![endif]--> will target IE6 only.

  3. #3
    Join Date
    Jan 2009
    Posts
    140

    Re: some Javascript files only recognize in IE and not in others

    Make sure that you call the script when the document has finished loading (that will mean that you will not be able to use document.write()) , otherwise make sure you don't use the XHTML doctype. The comment is not HTML and is therefore ignored by other browsers who will continue to parse the HTML within.

  4. #4
    Join Date
    Mar 2008
    Posts
    192

    Re: some Javascript files only recognize in IE and not in others

    Sometimes you just have to sniff for Internet Explorer 6 (and under) in JavaScript. Using conditional comments is a decent solution, using invalid HTML is never something that should be encouraged, particularly as we move towards XHTML and serving webpages as well formed XML which will break if invalid structures are used. If you're not using XHTML (you'll know if your not) it still pays to avoid using hacky Javascript methods to generate HTML elements during rendering.

Similar Threads

  1. unable to recognize files in vlc.
    By Kulvinderji in forum Windows Software
    Replies: 3
    Last Post: 16-12-2011, 04:48 AM
  2. Mac shows JavaScript error while opening files on SkyDrive
    By Lilija in forum Operating Systems
    Replies: 3
    Last Post: 21-12-2010, 07:37 PM
  3. Dynamically Loading External JavaScript and CSS Files
    By Adrina_g in forum Software Development
    Replies: 5
    Last Post: 02-03-2010, 11:36 AM
  4. How to Use javascript to control flash files?
    By Taipai in forum Software Development
    Replies: 3
    Last Post: 15-09-2009, 06:43 PM
  5. Movie Maker won't recognize .avi files
    By Smowrey in forum Vista Help
    Replies: 7
    Last Post: 30-05-2009, 06:44 AM

Tags for this Thread

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
  •  
Page generated in 1,713,957,351.49878 seconds with 16 queries