Jump to content

Mobile version doing

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
5 replies to this topic

#1
jclarke

jclarke

    Programmer

  • Members
  • PipPipPipPip
  • 106 posts
Just wanted to find out if anyone on this forum know some codes that the html can automatically recongise that this website is viewing from iPhones and other such mobile phone internet viewing?

Or what is the appropiate codes to size it up to view properly as I am currently in the construction to build a mobile version website with my major project....

Any assistance would be appericated :)

#2
jclarke

jclarke

    Programmer

  • Members
  • PipPipPipPip
  • 106 posts
Ahhh, never ind this thread - I found the code.

<script type="text/javascript">

<!--

if (screen.width <= 699) {

document.location = "url goes here";

}

//-->

</script>

This one worls very well.

#3
jwxie518

jwxie518

    Speaks fluent binary

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,180 posts
This is a good start, but I will not be happy with this script because this width is not reliable.
I would have the js check the user.agent, which will always work.

#4
jclarke

jclarke

    Programmer

  • Members
  • PipPipPipPip
  • 106 posts
Ahh, been a while - I have been looking for a better redirection code for the iPhone users
when people visit particular website and the code I used earlier as posted earlier on the 23rd November 2009 doesn't work anymore. Does anyone have a better coding template that will actually work?

#5
Alexander

Alexander

    It's Science!

  • Moderators
  • 4,118 posts

jclarke said:

Ahh, been a while - I have been looking for a better redirection code for the iPhone users
when people visit particular website and the code I used earlier as posted earlier on the 23rd November 2009 doesn't work anymore. Does anyone have a better coding template that will actually work?

There is a good overview of methods here including CSS/JS/PHP methods Detect Mobile Devices - Detect iPhones - Detect PDAs - Detect SmartPhones

The PHP method could send the page before the JS is loaded so it may be a bit faster, if you want to go that way post in the PHP forum and I'd be glad to help!
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.

#6
jclarke

jclarke

    Programmer

  • Members
  • PipPipPipPip
  • 106 posts

Nullw0rm said:

There is a good overview of methods here including CSS/JS/PHP methods Detect Mobile Devices - Detect iPhones - Detect PDAs - Detect SmartPhones

The PHP method could send the page before the JS is loaded so it may be a bit faster, if you want to go that way post in the PHP forum and I'd be glad to help!

PHP would be more easier - so I'll see if I can get something in PHP section...