Ver Mensaje Individual
  #3 (permalink)  
Antiguo 15/04/2010, 11:26
zm2175
 
Fecha de Ingreso: marzo-2003
Ubicación: Santiago
Mensajes: 53
Antigüedad: 21 años, 2 meses
Puntos: 0
Respuesta: redireccionar una web al diseño iphone

Gustabo, encontré esto que quizas te ayude...


If you want to detect an iPhone, and serve content specifically to iPhone and iPod touch users, you can check the browser’s user agent string, which is an identifier that the browser sends to a server when it is asking to view a file. The iPhone’s user agent string is reported as something like this:

HTTP_USER_AGENT=Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en)
AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1C25 Safari/419.3

As you can see, it includes the word “iPhone” in there, as well as saying that the browser uses the same KHTML rendering engine as Safari on the desktop. Using JavaScript, we can check for the presence of this text and then make the page behave differently using this browser detect:

Código:
var agent = navigator.userAgent.toLowerCase();
var is_iphone = ((agent.indexOf('iphone') != -1);
if (is_iphone) {
    // do something here
}
It’s wise not to do too much here that is specific to a certain mobile phone, especially as more devices are coming onto the market with similar functionality. But a few little touches here and there are always welcome.
__________________

==
Zmaster rulez!