How to create "information bar"

Discussion in 'HTML & Website Design' started by cesium, Feb 18, 2008.

  1. #1
    I've seen it on site before, but can't figure out how to create an "information bar" that you can customize.

    Does anyone know what code is necessary? Also, does anyone know a way to make it appear if the visitor is using IE, and not any other browsers?

    thanks!
     
    cesium, Feb 18, 2008 IP
  2. elgourmet

    elgourmet Guest

    Messages:
    55
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    what do you mean with an information bar? got any examples?
     
    elgourmet, Feb 18, 2008 IP
  3. lock

    lock Banned

    Messages:
    205
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #3
    An example would be good as I'm not sure what you mean bu information bar. You would need to use a scripting language to firgure out which browser was being used and then allow a pop up if that met certain criteria, i'm guess this could be done with javascript or php.
     
    lock, Feb 18, 2008 IP
  4. cesium

    cesium Guest

    Messages:
    121
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    sorry, i meant the information bar that comes in internet explorer.
    [​IMG]
     
    cesium, Feb 18, 2008 IP
  5. lock

    lock Banned

    Messages:
    205
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #5
    That is an automatic pop up when you need to download something usually and the browser restricts the normal way of doing so. I'm not so sure how you would een go about doing that if it is possible.
     
    lock, Feb 18, 2008 IP
  6. innovati

    innovati Peon

    Messages:
    948
    Likes Received:
    63
    Best Answers:
    1
    Trophy Points:
    0
    #6
    To do this is quite simple, you need to check for the user.agent of the browser that's viewing the page. You can also check the operating system and other neat things.

    Now I don't know why you'd want to make it IE only, but that's not my place to question.

    The only downside to user.agent checking is that other browsers, like firefox, konqueror and many more, can actually 'spoof' that is, report that they are a different browser they are not.

    One way to cut back agent spoofing if it's really importnt that only IE users can see it is to alo check the operating system: no current internet explorer browsers run on the mac or linux/unix

    So if you retained only windows users, and only those reporting to use IE, you'd prolly have a couple of spoofers but that's the closest I think you could get.

    ((EDIT))

    After seeing what you mean by information bar, you could also design an information bar that looked the same in *all* broswers, and change what browser ID was in the text by whatever user.agent they reported they are using. The bar would look the same to all browsers, but where it says Internet Explorer in IE, it would then say Safari, in safari, and firefox in firefox.
     
    innovati, Feb 18, 2008 IP
    cesium likes this.
  7. cesium

    cesium Guest

    Messages:
    121
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    I know what it is. It has been emulated on various sites however. Thanks though.

    Yeah, that's pretty close to what I need. The couple of spoofers that get through don't bother me, so user agent would be enough.
    I'm assuming this would be done with javascript? using an if-then statement? i dunno any javascript so this'll be complicated :p

    pretty much what im trying to do is: if browser is IE, then show "information bar". if browser is not IE, then don't show "information bar".


    EDIT: i found an information bar made in css, but have yet to try it.

    EDIT2: would hte javascript be something like this:
    <script language="JavaScript">
    if(navigator.userAgent.indexOf("MSIE") != -1)
    {
       <div id="infobar">TEXT</div>;
    }
    </script>
    Code (markup):
     
    cesium, Feb 18, 2008 IP