【问题标题】:App Banners for Android (smartbanner.js)适用于 Android 的应用横幅 (smartbanner.js)
【发布时间】:2014-05-21 13:36:31
【问题描述】:

在一个空的 HTML 页面中,我尝试显示一个包含我的应用链接的横幅

我用这个作为教程: http://www.dunnsolutions.com/content/application-development-blog/-/blogs/smart-app-banners-for-ios-and-android

目前,我只是尝试让它在本地工作,在一个空白页面中。这是我的页面:

<html>
  <head>
    <title>Hulu Plus</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <meta name="author" content="Hulu LLC">
    <meta name="google-play-app" content="app-id=MyAppIdIsHere">
    <link rel="stylesheet" href="jquery.smartbanner.css" type="text/css" media="screen">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.min.js"></script>
    <script src="jquery.smartbanner.js"></script>
    <script type="text/javascript">
        $(function () {
        $.smartbanner({
          title: 'Audience Opinion',
          author: 'Dunn Solutions Group'
        });
        })
    </script>
  </head>
  <body>
  </body>
</html>

我的 html 页面和 js/css 文件位于同一个文件夹中。路径没有问题。

有谁知道为什么这段代码不起作用? 提前致谢!

【问题讨论】:

  • 实际发生了什么?您是否在浏览器控制台中查看过错误?
  • 你没有给我们任何信息继续下去。 “有谁知道为什么这段代码不起作用”什么也没给我们。除非您解释,否则我们无法为您提供帮助。
  • 好吧,我看不出在这种情况下还需要什么。我正在尝试在 android play store 上显示一个横幅,其中包含指向我的应用程序的链接(上面给出的链接)。没有 JS/css 错误,找到所有文件但没有触发横幅。它正确输入了我的 JS 函数,我尝试了警报。

标签: android jquery windows banner smartbanner


【解决方案1】:

默认选项是仅在 Android 或 iOS 设备上显示该栏。如果您在桌面上打开该页面,则不会出现任何内容。您可以将 'force' 选项设置为 'windows' 以使其显示在您的桌面上。

$(function () { $.smartbanner({ daysHidden: 0, daysReminder: 0, title:'Hulu', force:'windows' }) })

所有其他选项都可以在 github 页面上找到:https://github.com/jasny/jquery.smartbanner

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-29
    • 2012-10-15
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多