Lost Password?

Go Back   CodeCall Programming Forum > Web Development Forum > JavaScript and CSS

Unregistered, Check out the Coder Battles in the Announcement and Game forums.

JavaScript and CSS Extensible Markup Language, Java Script, and CSS questions here.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-22-2008, 03:27 AM
psychological psychological is offline
Newbie
 
Join Date: Jan 2008
Posts: 1
Credits: 0
Rep Power: 0
psychological is on a distinguished road
Default Javascript + browsers question

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!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 01-22-2008, 06:27 AM
v0id's Avatar   
v0id v0id is offline
Super Moderator
 
Join Date: Apr 2007
Location: Denmark
Posts: 2,578
Last Blog:
CherryPy(thon)
Credits: 55
Rep Power: 28
v0id is a glorious beacon of lightv0id is a glorious beacon of lightv0id is a glorious beacon of lightv0id is a glorious beacon of lightv0id is a glorious beacon of lightv0id is a glorious beacon of light
Send a message via MSN to v0id
Default

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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 01-27-2008, 09:39 AM
csmith1991 csmith1991 is offline
Newbie
 
Join Date: Dec 2007
Posts: 6
Credits: 0
Rep Power: 0
csmith1991 is on a distinguished road
Default

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>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

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


All times are GMT -5. The time now is 07:11 PM.

Contest Stats

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

Contest Rules

CodeCall Goal

Goal: 100,000 Posts
Complete: 82%

Ads