|
||||||
| JavaScript and CSS Extensible Markup Language, Java Script, and CSS questions here. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
Hey everyone, im beginning to learn javascript/c++ and programming in general, however I was trying to wrap my head around javascript today. I was wondering if anyone could explain to me how JavaScript can be used to display things differently in two different browsers?
Thanks for any help, helping me to understand this! |
| Sponsored Links |
|
|
|
|||||
|
You determine which browser the user are running, and then you show something for the user if he uses a specific browser. There's tons of material on the net about determining browsers.
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum C/C++ resources - C/C++ frequently asked questions Python resources - Python frequently asked questions I'm always up for a chat, so feel free to contact me... |
|
|||
|
Somthing like this allows you to detect the browser that is being used and display unique content depending on the browser.
<script> var BrowserName = navigator.appName if (BrowserName == "Netscape") { alert("Your using Netscape"); } else { if (browserName == "Microsoft Internet Explorer") { alert("Your using IE"); } else { alert("What ARE you browsing with here?"); } } </script> |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| PHP accessing through remotely javascript from another website | deny | Request Services (Paid) | 4 | 01-28-2008 08:02 AM |
| [Easy as Pie] Unobtrusive JavaScript | Kernel | Programming News | 0 | 12-20-2007 09:07 AM |
| Counting Files with JavaScript | Matt | JavaScript and CSS | 5 | 08-01-2007 12:02 PM |
| Quikly help javascript | help | JavaScript and CSS | 2 | 02-20-2007 08:45 AM |
| Xav | ........ | 1333.07 |
| MeTh0Dz|Reb0rn | ........ | 1055.7 |
| John | ........ | 881.37 |
| morefood2001 | ........ | 879.43 |
| marwex89 | ........ | 869.98 |
| WingedPanther | ........ | 851.68 |
| Brandon W | ........ | 757.44 |
| chili5 | ........ | 312.39 |
| Steve.L | ........ | 247.05 |
| dcs | ........ | 217.87 |
Goal: 100,000 Posts
Complete: 82%