Welcome Guest [Log In] [Register]
Search Members Calendar | Rules ZB Code Index IF Code Index
ZBCode
  • Navigation
  • ZBCode
  • Coding Resources
  • Code Requests
  • Completed Requests
  • [Completed] [ZB] browser recognition
Hey, welcome to ZBCode, the premier coding forum for ZB. Here you fill find some of the best Invisionfree and Zetaboards Codes on the network! Unfortunately, you're sorta hovering around in guest mode at the moment; why not join in on the fun? Register an account and you can start accessing the wealth of resources we have available here. Enjoy your stay at ZBCode, and remember to tell all your friends about us; the more members, the more codes available. ;)

Interested in joining? Click here.


If you are already a member of ZBCode, feel free to login right here:

Username:   Password:
Locked Topic
[Completed] [ZB] browser recognition
Tweet Topic Started: Sep 25 2009, 01:16 PM (307 Views)
Ava Sep 25 2009, 01:16 PM Post #1
Member Avatar
A.V.A

Posts:
276
Group:
Member
Member
#3,254
Joined:
Jun 25, 2009
Hello.

I was wondering if there's a code that will recognize which browser my board is being viewed by. If so, is there a way I can display a certain <div> for only one browser, on my ZetaBoard webpage?

Ava
Edited by Ava, Sep 25 2009, 02:01 PM.
Posted Image
Offline Profile Goto Top
 
Reid Sep 25 2009, 04:27 PM Post #2
Member Avatar
What? The land of the free? Whoever told you that was your enemy.

Posts:
1,790
Group:
Distinguished Coder
Member
#148
Joined:
Jul 20, 2008
Code:
 
<script type='text/javascript'>
// <![CDATA[
if (navigator.appName.indexOf("Netscape")!=-1) {
document.write("<div>something</div>");
}
// ]]>
</script>
Firefox and Chrome's 'name' is Netscape; Internet Explorer's name is 'Microsoft Internet Explorer', so yeah. Opera is Opera, I think.
The Resource Board
Offline Profile Goto Top
 
Ava Sep 25 2009, 04:40 PM Post #3
Member Avatar
A.V.A

Posts:
276
Group:
Member
Member
#3,254
Joined:
Jun 25, 2009
Reid, how do I make it write the div in a specific spot in my webpage, though?
Edited by Ava, Sep 25 2009, 04:42 PM.
Posted Image
Offline Profile Goto Top
 
Reid Sep 25 2009, 05:56 PM Post #4
Member Avatar
What? The land of the free? Whoever told you that was your enemy.

Posts:
1,790
Group:
Distinguished Coder
Member
#148
Joined:
Jul 20, 2008
That code... the part that says <div>something</div>
The Resource Board
Offline Profile Goto Top
 
Ava Sep 25 2009, 06:39 PM Post #5
Member Avatar
A.V.A

Posts:
276
Group:
Member
Member
#3,254
Joined:
Jun 25, 2009
That means the <div> would need to already exist on the webpage though, no? I was wondering if there's a way to show an all new one on the webpage, only for one browser type.
Posted Image
Offline Profile Goto Top
 
Gorgor Sep 25 2009, 07:11 PM Post #6
Hello

Posts:
1,187
Group:
Former Staff
Member
#2,728
Joined:
Apr 2, 2009
Coding language
PHP
It creates a new <div>. Just enter the text you want it to display per browser and that code creates a completely new one. :)
Offline Profile Goto Top
 
Ava Sep 26 2009, 12:05 PM Post #7
Member Avatar
A.V.A

Posts:
276
Group:
Member
Member
#3,254
Joined:
Jun 25, 2009
Thanks. This request is complete :)
Posted Image
Offline Profile Goto Top
 
Reid Sep 26 2009, 12:18 PM Post #8
Member Avatar
What? The land of the free? Whoever told you that was your enemy.

Posts:
1,790
Group:
Distinguished Coder
Member
#148
Joined:
Jul 20, 2008
You're welcome.
See? We can read thoughts too. ;)

Your request has been completed, and we're moving it to the correct forum. We hope it works for you; if it doesn't, feel free to post another request topic in the requests forum. Just remember: read the rules first!

Thanks,
The ZBCode Staff
The Resource Board
Offline Profile Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · Completed Requests · Next Topic »
Locked Topic

Track Topic · E-mail Topic Time: 2:27 PM Jul 11
Hosted for free by ZetaBoards · Privacy Policy