SitesMasstec
Technical User
Dear colleagues:
Inside <BODY> in my HTML code I have:
(in order to determine if the user browser is a Mobile one, return True.
If it is not a Mobile browser, then return False)
Well, in the same HTML page I have: (in order to display a Flash animated banner)
I would like to execute the above code (the banner) if the function detectmob() returns False.
If it returns True, it is because the user browser is a Mobile one, so, instead of the animated banner in Flash I would like to display an static image:
How to accomplish this?
Is there a command in HTML or I will have to change the <object> command to Javascript?
Thank you,
SitesMasstec
Inside <BODY> in my HTML code I have:
(in order to determine if the user browser is a Mobile one, return True.
If it is not a Mobile browser, then return False)
Code:
<script type="text/javascript">
function detectmob() {
if( navigator.userAgent.match(/Android/i)
|| navigator.userAgent.match(/webOS/i)
|| navigator.userAgent.match(/iPhone/i)
|| navigator.userAgent.match(/iPad/i)
|| navigator.userAgent.match(/iPod/i)
|| navigator.userAgent.match(/BlackBerry/i)
|| navigator.userAgent.match(/Windows Phone/i)
){
return true;
}
else {
return false;
}
}
</script>
Well, in the same HTML page I have: (in order to display a Flash animated banner)
Code:
<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='[URL unfurl="true"]http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0'[/URL] width='720' height='100'><param name='movie' value='receitas1.swf'/><param name='wmode' value='#ffffff'/><param name='quality' value='high'/><embed src='receitas1.swf' quality='high' wmode='#ffffff'pluginspage='[URL unfurl="true"]http://www.macromedia.com/go/getflashplayer'[/URL] type='application/x-shockwave-flash' width='720' height='100'></embed>
</object>
I would like to execute the above code (the banner) if the function detectmob() returns False.
If it returns True, it is because the user browser is a Mobile one, so, instead of the animated banner in Flash I would like to display an static image:
Code:
<IMG SRC="receitas1_256.gif" WIDTH="80%">
How to accomplish this?
Is there a command in HTML or I will have to change the <object> command to Javascript?
Thank you,
SitesMasstec