javascript - Need to have an iPad friendly (html) header file load when detected instead of regular flash header -


i have client wants make website ipad/iphone friendly. website has menu header made in flash. converted file using google's swiffy flash_1.html file.

when website detects ipad/iphone want load swiffy flash_1.html file. otherwise, should load site normal.

i having trouble doing this, writing correct if/else statement , having work. realize have change body tag onload regular site else since it's going function. sort of problem i'm running into.

anyways, input or appreciated! xd

this have far:

<script type="text/javascript">  if ((navigator.useragent.indexof('iphone') != -1) || (navigator.useragent.indexof('ipod') != -1) || (navigator.useragent.indexof('ipad') != -1)) {     document.location = "mobile/";  $(function{ $("#includedcontent").load("flash_1.html"); }); else 

the regular site's code looks this:

***note: not code appear correctly in text window, made image. (the information cut off on top functions script preloadimages, , swap images)

website code

sniffing browser isn't way go, why not see if can run flash?

if(swfobject.hasflashplayerversion("1")) { //flash supported } else { //flash not supported } 

Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -