开发者

JQuery Mobile Blackberry workaround

I have been trying to get a working emulator to test this, but I keep getting errors.

I have a mobile app that uses JQuery Mobile. Unfortunately (as far as I know) blackberry (not 6.0) does not support JQuery mobile.

To get around this I am trying to do this method:

  1. On pageload of my app check to see if the phone is a black berry
  2. If black berry redirect away from jquery mobile page to regular html

Question开发者_StackOverflow社区s:

1) Is there a better way to do this? I have all the functionality in my JQuery mobile so a quick workaround that would work with that would be best

2) How can you detect if a phone is a blackberry? I was thinking something along the lines of this (Haven't been able to test it fully because I cannot get my sim working)

   //Checks to see if the phone is a blackberry
    if (Request.Headers["User-Agent"] != null && (Request.Browser["IsMobileDevice"] == "true" || Request.Browser
        ["BlackBerry"] == "true" || Request.UserAgent.ToUpper().Contains("MIDP") || Request.UserAgent.ToUpper
        ().Contains("CLDC")) || Request.UserAgent.ToLower().Contains("iphone"))
       {
          Response.Redirect("Blackberry/FirstPage.htm");
       }

On another note, what is a good simulator for blackberry? I tried the accepted SO answer here but I cannot get web access and the older versions are throwing many errors.

Thanks


Check the Jquery mobile blog for more information on BlackBerry Support

http://jquerymobile.com/blog/2011/05/27/jquery-mobile-team-update-week-of-may-23/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜