我刚刚通过CLI创建了一个新的cordova ios项目,我在Xcode 7.1中打开了该项目,并且在模拟器上运行时在mainViewController.xib上出现了一些错误,如果我们点击该错误它显示的xib文件并在其上显示一个警告消息"发生内部错误.编辑功能可能受限".所以我无法运行这个项目.
我不知道这是由于Xcode bug还是cordova bug或我的Xcode中的任何其他设置问题.
我想使用HTML 5和JQuery为windows phone 8使用多选下拉列表.
以下代码在IOS,Android和IE浏览器中都运行良好.但在应用程序中它表现得像简单的选择框,不能做多个选择.
<select id="oID_1" size="3" multiple>
<option>Item 1</option>
<option>Item 2</option>
<option>Item 3</option>
</select>
Run Code Online (Sandbox Code Playgroud)
现在我正在获得这样的弹出窗口(来自Phone的截图):
但我想要这样的东西(来自IE浏览器的截图):
我只是使用Terminal创建一个IOS Phonegap应用程序,然后在config.xml中更改UIWebViewBounce t = false,并删除body内的所有内容,并删除所有CSS数据.
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="format-detection" content="telephone=no" />
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />
<link rel="stylesheet" type="text/css" href="css/index.css" />
<title>Hello World</title>
<script type="text/javascript" src="cordova-2.4.0.js"></script>
</head>
<body>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
这是我的HTML页面,我的index.css为空,我的Phonegap版本为2.4.然后我运行应用程序:

当我尝试滚动空白页面时,会出现一个滚动条:
为什么?谁能帮帮我吗?
**UPDATE已解决:只需从元标记中删除height = device-height或删除状态栏**
我的问题是如何阻止用户关闭应用程序?.我需要一条警告消息,询问用户是否真的要离开应用程序.我的应用程序是在Adobe AIR中开发的.请帮忙,我遇到了麻烦.
安装新的phonegap即phonegap 2.0我得到了这个错误任何一个请帮我解决这个错误iam使用xcode 4.3.2 ios 5.1:
缺少依赖项目标"CordovaLib(来自CordovaLib.xcodeproj)"
CpResource/VERSION /Users/arjun/Library/Developer/Xcode/DerivedData/MenuApp-emlsuylgddtbitggsiybbtqsxxmb/Build/Products/Debug-iphonesimulator/MenuApp.app/VERSION
cd /Users/arjun/Desktop/MenuApp
setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
builtin-copy -exclude .DS_Store -exclude CVS -exclude .svn -exclude .git -exclude .hg -resolve-src-symlinks -strip-tool /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip /VERSION /Users/arjun/Library/Developer/Xcode/DerivedData/MenuApp-emlsuylgddtbitggsiybbtqsxxmb/Build/Products/Debug-iphonesimulator/MenuApp.app
Run Code Online (Sandbox Code Playgroud)
错误:/ VERSION:没有这样的文件或目录
我们如何使用带有需要js的Phonegap?我尝试使用require()方法添加到phonegap.我的代码如下所示,所有.js文件都在正确的位置.请帮助我,它可以通过AMD加载phonegap,或使用普通的脚本方法
<script type="text/javascript" src="cordova.js"></script>
Run Code Online (Sandbox Code Playgroud)
这是我的require配置和方法
require.config({
baseUrl: 'js/lib',
paths: {
controller: '../controller/controller',
model: '../model/model',
view: '../view/view',
router:'../router/router'
},
/* map: {
'*': {
'tempName': 'actualName'
}
},*/
shim: {
'backbone': {
deps: ['underscore', 'jquery','cordova'],
exports: 'Backbone'
},
'underscore': {
exports: '_'
}
}
});
require(['jquery', 'backbone', 'router', ], function ($, Backbone, Router) {
document.addEventListener('deviceready', function () {
alert('hi'); // working
navigator.notification.alert('hi'); // not working
}, false);
});
Run Code Online (Sandbox Code Playgroud) 我想在服务工作者和客户端网页之间实现有效的 2 路通信。
这是我的代码
function twoWayMsg() {
if (navigator.serviceWorker.controller) {
var messageChannel = new MessageChannel();
messageChannel.port1.onmessage = function(event) {
console.log("Response the SW : ", event.data.message);
}
console.log("Sendingage to the service worker");
navigator.serviceWorker.controller.postMessage({
"command": "twoWayCommunication",
"message": "Hi, SW"
}, [messageChannel.port2]);
} else {
console.log("Nove ServiceWorker");
}
}
Run Code Online (Sandbox Code Playgroud)
和
self.addEventListener('message', function(event) {
var data = event.data;
if (data.command == "twoWayCommunication") {
console.log("Respondingessage from the Page: ", data.message);
event.ports[0].postMessage({
"message": "Hi, Page"
});
}
});
Run Code Online (Sandbox Code Playgroud)
每次都创建 MessageChannel 对象好吗?
如果我将全局变量用于消息通道对象,则会收到此错误
Failed to execute 'postMessage' …Run Code Online (Sandbox Code Playgroud) javascript ecmascript-6 service-worker message-channel service-worker-events
这是我的HTML:
<div class="accor">
</div>
<div class="accordionContentTwoCol">
<p class="noEdit">
<div> name : </div>
</p>
<div>
Run Code Online (Sandbox Code Playgroud)
我需要找到accordionContentTwoColdiv的html内容(我只能访问accor).
如果我尝试在accordionContentTwoCol div中打印html,如下所示:
alert("html inside accordionContentTwoCol :"+$('.accor').next().html());
Run Code Online (Sandbox Code Playgroud)
它提供如下输出:

虽然HTML里面accordionContentTwoCol是:
<p class="noEdit">
<div> name : </div>
</p>
Run Code Online (Sandbox Code Playgroud)
为什么会这样?
嗨,我无法在单击关闭按钮时(或在加载某些 url 后的任何时间)检索 inapp 浏览器的当前 url,我的代码如下
var ref = window.open('http://google.com', '_blank', 'hidden=yes');
ref.show();
ref.addEventListener('exit', function(event) {
alert(JSON.stringify(event)); // no data related to URL
});
ref.addEventListener('loadstop', function(){
alert(window.location.href); // always get local address ie File:/// ....
});
Run Code Online (Sandbox Code Playgroud)
请帮我。我找到了这个问题,但没有得到任何答案