让智能提示条不显示在iPad上

应用中有一个网页显示的智能提示条,使用HTML meta tag,我想要它能在iPhone和iPod中显示,而在iPad中不显示。

应该怎么办?

苹果的一些文档:

http://developer.apple.com/library/ios/#documentation/AppleApplications/Reference/SafariWebContent/PromotingAppswithAppBanners/PromotingAppswithAppBanners.html

代码:

<meta name="apple-itunes-app" content="app-id=myAppStoreID">

需要用JavaScript实现,在html平台没有相关的方法。

删除HTML代码中的HTML meta tag,再使用下面的代码:

(function($){
  var is_iPad = navigator.userAgent.match(/iPad/i) != null;

  // Fill in your Apple-App stuff here
  var app_id = "<YOUR_APPLE_APP_ID>",
      affiliate_data = null,
      app_argument = null;

  // exclude iPad
  if(!is_iPad) {
    var meta = $("<meta>"), content = 'app-id=' + app_id;
    meta.attr('name', 'apple-itunes-app');

    // Optional stuff (only when filled in)
    if(affiliate_data) content += ', affiliate-data=' + affiliate_data;
    if(app_argument) content += ', app-argument=' + app_argument;

    // Apply
    meta.attr('content', content);
    $('head').append(meta);
  }
}(jQuery));