Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Web Coding › redirecting with JS and browser dection
New Posts  All Forums:Forum Nav:

redirecting with JS and browser dection

post #1 of 4
Thread Starter 
Does anyone know know to detect what browser a device is using and redirect it to a different page? What I want to do is, at the start of an HTML file, referance a script that will check the browser, and if it is an Apple device, redirect the user to an HTML5 version of the site.

Any suggestions? I know very little js atm
The Lie v2
(18 items)
 
  
CPUMotherboardGraphicsRAM
i5 4690k ASRock z97 Extreme 4 EVGA GTX 1070 Crucial 
Hard DriveHard DriveHard DriveCooling
Crucial MX300 WD Caviar Blue 500 Gb Crucial MX300 Corsair H100i 
OSOSMonitorKeyboard
Manjaro Win10 lg29um58 Ducky One TKL RGB 
PowerCaseMouseMouse Pad
OCZ Modxtreme 600w INWin 303 Logitech G602 Rubber 
AudioOther
HD598 Lots of fans 
  hide details  
Reply
The Lie v2
(18 items)
 
  
CPUMotherboardGraphicsRAM
i5 4690k ASRock z97 Extreme 4 EVGA GTX 1070 Crucial 
Hard DriveHard DriveHard DriveCooling
Crucial MX300 WD Caviar Blue 500 Gb Crucial MX300 Corsair H100i 
OSOSMonitorKeyboard
Manjaro Win10 lg29um58 Ducky One TKL RGB 
PowerCaseMouseMouse Pad
OCZ Modxtreme 600w INWin 303 Logitech G602 Rubber 
AudioOther
HD598 Lots of fans 
  hide details  
Reply
post #2 of 4
Have a look here. Then read this and smile thumb.gif

/NwP
T3h R1g[FTW]
(17 items)
 
   
CPUMotherboardGraphicsGraphics
Q9550 E0 @ 3.88 GHz (1.26v) Evga 780i SLi FTW XFX 9800 GT XFX 9800 GT 
RAMHard DriveHard DriveHard Drive
OCZ Blade PC8500 CL5 OCZ Vertex WD Caviar Green WD Caviar Green 
CoolingOSMonitorKeyboard
Noctua NH-U12P Windows 7 Pro x64 Samsung P2350 23" 2ms Razer Lycosa 
PowerCaseMouseMouse Pad
CM Real Power RS-520 CM 690 Roccat Kone QcK SK Limited 
Audio
Sennheiser PC 151 
CPUMotherboardGraphicsRAM
i7 950 @ 4 GHz no HT Asus Sabertooth X58 Evga GTX480 SC Mushkin Redline CL6 
Hard DriveCoolingCoolingOS
Seagate EK Supreme Cupper/Acetal EK FC480 GTX Nickle/Acetal Win 7 Pro x64 
MonitorKeyboardPowerCase
Samsung 23" Razor Lycosa Coolermaster Silent Pro M 850 Silverstone TJ07B-W 
MouseMouse Pad
Roccat Kone QcK Limited 
  hide details  
Reply
T3h R1g[FTW]
(17 items)
 
   
CPUMotherboardGraphicsGraphics
Q9550 E0 @ 3.88 GHz (1.26v) Evga 780i SLi FTW XFX 9800 GT XFX 9800 GT 
RAMHard DriveHard DriveHard Drive
OCZ Blade PC8500 CL5 OCZ Vertex WD Caviar Green WD Caviar Green 
CoolingOSMonitorKeyboard
Noctua NH-U12P Windows 7 Pro x64 Samsung P2350 23" 2ms Razer Lycosa 
PowerCaseMouseMouse Pad
CM Real Power RS-520 CM 690 Roccat Kone QcK SK Limited 
Audio
Sennheiser PC 151 
CPUMotherboardGraphicsRAM
i7 950 @ 4 GHz no HT Asus Sabertooth X58 Evga GTX480 SC Mushkin Redline CL6 
Hard DriveCoolingCoolingOS
Seagate EK Supreme Cupper/Acetal EK FC480 GTX Nickle/Acetal Win 7 Pro x64 
MonitorKeyboardPowerCase
Samsung 23" Razor Lycosa Coolermaster Silent Pro M 850 Silverstone TJ07B-W 
MouseMouse Pad
Roccat Kone QcK Limited 
  hide details  
Reply
post #3 of 4
DON'T DO IT! Just use HTML5. All modern browsers support it and most of the old ones handle it decently.

Check out HTML5 Boilerplate for a really good html 5 starting point that will work in most all browsers and fall back gracefully. Include modernizr in your custom build to be able to handle non-supported functionality easly.

HTML5 Boilerplate
White TITAN
(16 items)
 
   
CPUMotherboardGraphicsRAM
intel core i7-3770k Asus Z77 Sabertooth EVGA GTX 780 SC ACX Corsair Dominator Platinum 16GB (2x8GB) 
Hard DriveHard DriveHard DriveOptical Drive
Samsung 840 Pro  WD Black Crucial M4 LG Blueray 
CoolingOSMonitorPower
Swiftech H220 (Stock cooler on while RMA :( ) Windows 7 64bit Dell 2311h Ultrasharp x 2 Corsair AX850 
CaseMouseMouse PadAudio
Fractal Design Define R4 White (w/ Window) Logitech G700 Razer Control Edition Sound Blaster ZxR 
CPUMotherboardGraphicsRAM
Intel 980x Asus Rampage iii Extreme EVGA GTX580 SLI Patriot Viper Xtreme 12GB DDR3 2000 (PC3 16000) 
Hard DriveHard DriveHard DriveOptical Drive
120GB Corsair Force Series 3 SSD WD Caviar Black 640GB Crucial M4 128GB SSD LG Black Blu-ray Drive SATA Model UH12LS28 
CoolingCoolingCoolingCooling
XSPC RX360 and RX120 Rads Watercool HeatKiller 3.0 Limited Edition Black ... XSPC Dual Bay Res with Swiftech MCP655 Pump Silver Shining Bitspower Compression Fittings 
CoolingCoolingCoolingCooling
PrimoFlex Pro LRT Black Tubing -1/2in. ID X 3/4in. 3x Gentle Typhoon 120mm Fan 1850RPM (AP-15)  1x Noiseblocker NB-BlackSilentPro PL-2 120mm Ul... Koolance VID-NX580 Full Cover GPU Waterblock x2 
OSMonitorKeyboardPower
Windows 7 Home Premium x64 Dell U2311 Ultrasharp x2 Max Keyboard Nighthawk X8 Semi-Custom - Mechani... Antec High Current Gamer 900W 
CaseMouseMouse PadAudio
Xigmatek Elysium Black Logitech G700 Razer Goliathus Creative Sound Blaster Recon3D Fatal1ty Pro 
  hide details  
Reply
White TITAN
(16 items)
 
   
CPUMotherboardGraphicsRAM
intel core i7-3770k Asus Z77 Sabertooth EVGA GTX 780 SC ACX Corsair Dominator Platinum 16GB (2x8GB) 
Hard DriveHard DriveHard DriveOptical Drive
Samsung 840 Pro  WD Black Crucial M4 LG Blueray 
CoolingOSMonitorPower
Swiftech H220 (Stock cooler on while RMA :( ) Windows 7 64bit Dell 2311h Ultrasharp x 2 Corsair AX850 
CaseMouseMouse PadAudio
Fractal Design Define R4 White (w/ Window) Logitech G700 Razer Control Edition Sound Blaster ZxR 
CPUMotherboardGraphicsRAM
Intel 980x Asus Rampage iii Extreme EVGA GTX580 SLI Patriot Viper Xtreme 12GB DDR3 2000 (PC3 16000) 
Hard DriveHard DriveHard DriveOptical Drive
120GB Corsair Force Series 3 SSD WD Caviar Black 640GB Crucial M4 128GB SSD LG Black Blu-ray Drive SATA Model UH12LS28 
CoolingCoolingCoolingCooling
XSPC RX360 and RX120 Rads Watercool HeatKiller 3.0 Limited Edition Black ... XSPC Dual Bay Res with Swiftech MCP655 Pump Silver Shining Bitspower Compression Fittings 
CoolingCoolingCoolingCooling
PrimoFlex Pro LRT Black Tubing -1/2in. ID X 3/4in. 3x Gentle Typhoon 120mm Fan 1850RPM (AP-15)  1x Noiseblocker NB-BlackSilentPro PL-2 120mm Ul... Koolance VID-NX580 Full Cover GPU Waterblock x2 
OSMonitorKeyboardPower
Windows 7 Home Premium x64 Dell U2311 Ultrasharp x2 Max Keyboard Nighthawk X8 Semi-Custom - Mechani... Antec High Current Gamer 900W 
CaseMouseMouse PadAudio
Xigmatek Elysium Black Logitech G700 Razer Goliathus Creative Sound Blaster Recon3D Fatal1ty Pro 
  hide details  
Reply
post #4 of 4
Thread Starter 
Thanks a lot to the both of you, I love HTML5 Boilerplate now, its coooll wubsmiley.gif
The Lie v2
(18 items)
 
  
CPUMotherboardGraphicsRAM
i5 4690k ASRock z97 Extreme 4 EVGA GTX 1070 Crucial 
Hard DriveHard DriveHard DriveCooling
Crucial MX300 WD Caviar Blue 500 Gb Crucial MX300 Corsair H100i 
OSOSMonitorKeyboard
Manjaro Win10 lg29um58 Ducky One TKL RGB 
PowerCaseMouseMouse Pad
OCZ Modxtreme 600w INWin 303 Logitech G602 Rubber 
AudioOther
HD598 Lots of fans 
  hide details  
Reply
The Lie v2
(18 items)
 
  
CPUMotherboardGraphicsRAM
i5 4690k ASRock z97 Extreme 4 EVGA GTX 1070 Crucial 
Hard DriveHard DriveHard DriveCooling
Crucial MX300 WD Caviar Blue 500 Gb Crucial MX300 Corsair H100i 
OSOSMonitorKeyboard
Manjaro Win10 lg29um58 Ducky One TKL RGB 
PowerCaseMouseMouse Pad
OCZ Modxtreme 600w INWin 303 Logitech G602 Rubber 
AudioOther
HD598 Lots of fans 
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Web Coding
Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Web Coding › redirecting with JS and browser dection