www.webdeveloper.com
Results 1 to 8 of 8

Thread: Displaying Image in <IF IE>

  1. #1
    Join Date
    Oct 2013
    Posts
    10

    Displaying Image in <IF IE>

    Hey,
    I wanna do that when you enter my site with Internet Explorer browser, will display an image.
    How do I do it below the tags <IF IE> ?
    Because I know that you can do something like that through JavaScript and I don't know how.

    I tried to do it with <body onload="image.png"> but It'll show to Chrome and FireFox and Opera either, and as I said I want to show only to Internet Explorer.

    I thought to do it through <meta> tags but of course, it belong to HTML..

    Any ideas?

    Thanks!!

  2. #2
    Join Date
    Mar 2011
    Posts
    1,158
    You can use JavaScript to check the value of 'navigator.userAgent' to determine which browser is being used, but my advice would be to strongly consider dropping the idea entirely.

    If you're trying to suggest that users upgrade or change their browser, you're fighting a losing battle. People who are using older browsers either can't change because their employer's network environment won't let them, or they don't have the technical knowledge to understand how or why they should change. In either case, there's nothing to be gained by preaching to them.

    If you need to warn users that your site doesn't function well with Internet Explorer, then the burden is on you to design your site so that it's usable by just about any browser out there. The latest versions of IE support most of the latest features of HTML 5 and CSS 3, and there are good solutions for adding support for many of the most popular features to IE going back to IE8.

    If you'll explain why you want to send a message to IE users, the solution may be simpler than you think.

  3. #3
    Join Date
    Mar 2007
    Location
    U.K.
    Posts
    1,127
    Place this code wherever the image should appear:
    Code:
    <!--[if IE ]>   
      <img src = "myimage.jpg"> 
    <![endif]-->

  4. #4
    Join Date
    Oct 2013
    Posts
    10
    Quote Originally Posted by Logic Ali View Post
    Place this code wherever the image should appear:
    Code:
    <!--[if IE ]>   
      <img src = "myimage.jpg"> 
    <![endif]-->
    Doesn't work

  5. #5
    Join Date
    Mar 2007
    Location
    U.K.
    Posts
    1,127
    Quote Originally Posted by rolory View Post
    doesn't work
    url?

  6. #6
    Join Date
    Oct 2013
    Posts
    10
    Quote Originally Posted by Logic Ali View Post
    url?
    It's an image in my computer

  7. #7
    Join Date
    Mar 2007
    Location
    localhost
    Posts
    2,501
    How are you viewing the page? From your computer or through a webserver on your computer?
    Yes, I know I'm about as subtle as being hit by a bus..(\\.\ Aug08)
    Yep... I say it like I see it, even if it is like a baseball bat in the nutz... (\\.\ Aug08)
    I want to leave this world the same way I came into it, Screaming, Incontinent & No memory!
    I laughed that hard I burst my colostomy bag... (\\.\ May03)
    Life for some is like a car accident... Mine is like a motorway pile up...

    Problems with Vista? :: Getting Cryptic wid it. :: The 'C' word! :: Whois?

  8. #8
    Join Date
    Oct 2013
    Posts
    10
    Quote Originally Posted by \\.\ View Post
    How are you viewing the page? From your computer or through a webserver on your computer?
    Yep.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles