Windows 8下的InAppBrowser不起作用(InAppBrowser under Windows 8 doesn´t work)
我在不同平台下的Cordova项目中工作,例如iOS和Windows 8平板电脑,这个应用程序支持IE11或Chrome等浏览器,但我在使用InAppBrowser插件时遇到问题,在W8平板电脑下没有工作,如果你在不同的按钮“点击”打开附件,这个事件不起作用......有什么问题??!
我有一个班级来管理下一个代码...
openLinkInNewWindow: function (url) { var link = Ext.getDom(this.getLinkId()), clickevent = document.createEvent('Event'), hash = location.hash; if (Ext.browser.is.Standalone) { localStorage.setItem('lastVisitRouteForLunchApp', hash); } if (Ext.os.deviceType == "Tablet" && Ext.os.name == "Windows") { window.open(url, '_blank', 'location=yes'); } if (Ext.os.deviceType == "Tablet" && Ext.os.name == "iOS") { window.open(url, '_blank', 'location=yes'); } else { link.href = url; Ext.Function.defer(function () { clickevent.initEvent('click', true, false); link.dispatchEvent(clickevent); }, 500); } }
我究竟做错了什么? (代码基于Sencha Touch Framework)
I am working in a Cordova project under different platforms, for example iOS and Windows 8 tablet, this app works has support in browsers like IE11 or Chrome, but I am having problems with the implementation with the InAppBrowser plugin, under W8 tablet doesn´t work and if you do "tap" in different buttons to open attachments, this event doesn´t work... What is the problem??!
I have a class to manage this with the next code...
openLinkInNewWindow: function (url) { var link = Ext.getDom(this.getLinkId()), clickevent = document.createEvent('Event'), hash = location.hash; if (Ext.browser.is.Standalone) { localStorage.setItem('lastVisitRouteForLunchApp', hash); } if (Ext.os.deviceType == "Tablet" && Ext.os.name == "Windows") { window.open(url, '_blank', 'location=yes'); } if (Ext.os.deviceType == "Tablet" && Ext.os.name == "iOS") { window.open(url, '_blank', 'location=yes'); } else { link.href = url; Ext.Function.defer(function () { clickevent.initEvent('click', true, false); link.dispatchEvent(clickevent); }, 500); } }
What am I doing wrong? (code is based in Sencha Touch Framework)
原文:https://stackoverflow.com/questions/30169266
最满意答案
相关问答
更多-
让Qt Creator使用MinGW(Making Qt Creator use MinGW)[2023-02-26]
只是在这里添加一些更具体的信息。 当我最初在Windows上安装QtSDK时,我只有用于构建的MVSC选项。 为了解决这个问题,运行Update QT SDK程序并选择包管理器选项,点击下一步。 展开“Qt SDK” - >“开发工具” - >“桌面QT” - >“您的QT Verision(在撰写本文时为4.8.0(桌面))”,您应该只看到Qt旁边的复选框MSVC版本。 同时检查MinGW选项并在底部点击。 这将为qt创建者下载并安装mingw构建工具链。 然后您可以选择MinGW构建而不是MSVC。 J ... -
如何通过GUI在Qt Creator项目中添加外部.a库?(How to add an external .a library in Qt Creator project via GUI?)[2023-10-26]
据我所知,现在是不可能的。 唯一的方法是编辑.pro文件并添加这样的行: win32 { #/* If you compile with QtCreator/gcc: */ win32-g++:LIBS += -L"$$_PRO_FILE_PWD_/libs/" win32-g++:LIBS += -lyaml-cpp #/* IF you compile with MSVC: #win32-msvc:LIBS += /path/to/your/libMyLib.l ... -
这样做的正确方法是这样的: LIBS += -L/path/to -lpsapi 这样就可以在Qt支持的所有平台上工作。 想法是你必须将目录与库名分开(没有扩展名,没有任何'lib'前缀)。 当然,如果你包括一个Windows特定的lib,这真的没关系。 如果要将lib文件存储在项目目录中,可以使用$$_PRO_FILE_PWD_变量来引用它们,例如: LIBS += -L"$$_PRO_FILE_PWD_/3rdparty/libs/" -lpsapi The proper way to do thi ...
-
您需要一些Debian / Ubuntu软件包: sudo apt-get install libqt5webkit5 libqt5webkit5-dev libqt5webkit5-qmlwebkitplugin 某些模块有时难以找到包裹。 只需使用`apt-cache search'包'“或Synaptic Package Manager,并输入qt以及模块名称(例如”qtwebkit“)。 以下是包含该模块的示例: import QtQuick 2.0 import QtWebKit 3.0 Pag ...
-
如何使用qmake在qt-creator中向非qt-project添加资源(How to add resources to non qt-project in qt-creator using qmake)[2022-08-31]
在粉碎了我的脑袋一段时间后,我最终重组了我的项目并使用make而不是qmake。 这就像一个魅力。 然后我将我的自定义make脚本添加到Qt Creator中的构建步骤,以便我可以使用ctrl + r构建和运行。 After smashing my head against this for a while I ended up restructuring my project and using make instead of qmake. That worked like a charm. Then I ... -
如果您安装了SC系统,则在“工具”菜单下,您会看到它已列出。 例如,在我的作品中,Git似乎是一种选择。 选择Git时,子菜单有一个Create Repository选项。 选择后,它会要求您选择存储库的文件夹。 您需要安装外部工具,然后配置Qt创建者才能使用这些工具。 在Preferences下,选择Version Control,然后选择Git选项卡。 确保Git工具在Path中。 看这里的工具; https://git-scm.com/downloads 。 If you have a SC syst ...
-
编辑您的个人资料。 它应该有这样一行: QT += core gui 在此行中附加所需的模块。 要获取模块的名称,只需删除此列表中的“Qt”部分即可。 (例如QtSql变成“sql”) Edit your .pro file. It should has one line like this: QT += core gui Append the desired modules in this line. To get the module's names, just remove the "Qt" pa ...
-
在使用Qt Creator的Unix系统中开发Qt应用程序(Developing Qt applications in Unix systems using Qt Creator)[2023-11-13]
是的,Creator有一个部分,您可以在其中设置运行应用程序所需的任何环境。 在Creator 2.0.0上,可通过以下方式访问:项目 - >目标 - >(您的目标) - >运行 - >运行环境(打开项目后) 然后,您可以添加或删除任何您想要的环境变量,包括LD_LIBRARY_PATH我不确定的一件事是如果可以将构建路径替换为这些变量的值,以便您不必硬编码到您的LD_LIBRARY_PATH 。 另一个选择是将一个小的shell脚本添加到源代码树中,该脚本设置所需的任何变量,并添加“自定义可执行文件”运行 ... -
Qt Creator 2.6.2和Qt 4.8.4:未正确安装Qt版本(Qt Creator 2.6.2 and Qt 4.8.4: Qt version is not properly installed)[2022-12-29]
我有同样的问题。 尝试从BIN文件夹中选择“qmake.exe”,而不是qmake文件夹,所以在你的情况下可能是P:\ Qt \ Libs \ 4.8.4 \ bin \ qmake.exe Based on SO: How to install Qt on Windows after building? I eventually got to http://qt-project.org/doc/qt-4.8/install-win.html Simply running configure solved ... -
我总是明确添加我的头文件,以避免任何意外。 但在使用QtCreator 4.2.0和cmake 3.7.1的MacOS上,我无法重现您的问题。 但是,我建议使用以下结构来了解项目中的文件,并在更新CMakeLists.txt期间触发cmake数据的更新。 在project / CMakeLists.txt中: add_subdirectory(src) include_directory(include) add_executable(foo ${SRC_LIST}) 在project / src / C ...