我正在尝试用jQuery Mobile/PhoneGap编写移动应用程序.我正在使用此示例模板开始,它使用HTML/JS来创建页面.他没有将所有<page>
标签放在一个单独的html文件中,而是将其拆分,以便更容易编辑.
由于每个页面都有一个单独的文件,包含标题页眉/页脚的最佳方法是什么?我只看到你需要将整个页脚 - >导航栏代码复制并粘贴到每个HTML页面的位置.这似乎不应该是.例如,如果要更改一个菜单项,则需要进入每个页面并进行更改.
我缺少什么解决方案?
也许我只是不理解jQuery Mobile.例如,他们用于文档的侧边栏 - 侧边栏代码是否复制并粘贴到每个页面上?这没有意义.这与我在这里询问有关页脚的问题是一样的.
http://jquerymobile.com/test/docs/pages/page-cache.html
这就是我所拥有的那些似乎不对(并且$.live('pageinit')
不起作用).这个HTML是每个HTML页面上的内容:
<div id="mainFooter" data-position="fixed" data-id="mainFooter" data-role="footer" class="ui-footer ui-bar-a ui-footer-fixed fade ui-fixed-inline" role="contentinfo" style="top: 58px;">
Run Code Online (Sandbox Code Playgroud)
和JS
$.live('pageinit', function (event) {
displayFooter();
});
function displayFooter() {
$('#mainFooter').html('<div data-role="navbar" class="nav-glyphish-example" data-grid="d">' +
'<ul>' +
'<li><a href="#" id="menuitem1" data-icon="custom">Menu Item 1</a></li>' +
'<li><a href="#" id="menuitem2" data-icon="custom">Menu Item 2</a></li>' +
'<li><a href="#" id="menuitem3" data-icon="custom">Menu Item 3</a></li>' +
'</ul>' +
'</div>');
}
Run Code Online (Sandbox Code Playgroud) 不确定这是否已在某处覆盖,但我在文档中找不到它,并且想知道是否有可能不包含带有jQuery选择插件的搜索输入框(用于样式选择输入).具体来说,我想使用没有它的标准选择.
我正在将我的应用程序从ExtJs 3迁移到4版本.我在formPanel上有几个组合框,之前我使用了hiddenName和所有这些东西来提交valueField而不是displayField.
所有我的改编工作正常(值字段IS提交),但我无法设置组合框的默认值,它们在页面加载后显示为空.以前,我只是在config中指定'value'参数.有什么想法如何解决这个问题?
我的代码 - 模型和商店:
Ext.define('idNamePair', {
extend: 'Ext.data.Model',
fields: [
{name: 'id', type: 'string'},
{name: 'name', type: 'string'}
]
});
var dirValuesStore = new Ext.data.Store({
model: 'idNamePair',
proxy: {
type: 'ajax',
url: '../filtervalues.json',
reader: {
type: 'json',
root: 'dir'
}
},
autoLoad: true
});
Run Code Online (Sandbox Code Playgroud)
组合配置:
{
triggerAction: 'all',
id: 'dir_id',
fieldLabel: 'Direction',
queryMode: 'local',
editable: false,
xtype: 'combo',
store : dirValuesStore,
displayField:'name',
valueField:'id',
value: 'all',
width: 250,
forceSelection:true
}
Run Code Online (Sandbox Code Playgroud) 我正在使用带有节点js的MongoDB npm install mongodb
我想更新现有文档并返回更新的文档,文档正确更新.但它返回旧文档意味着更新前的原始文档.我使用了returnNewDocument:true
参数但没有用.
var filter = {
'_id': object_id
},
update = {
$set: { "status" : data["status"] },
$push: {
"statusHistory": {
$each: [{ status:data["status"],statusChangedTime:data["statusChangedTime"],comment:data["comment"]}],
$position:0,
}
},
}
,options = {
//upsert: false,
//multi: false,
returnNewDocument: true
};
col.findOneAndUpdate(filter, update, options,function(err, res) {
if (err) {
console.log(err);
}else {
console.log(res);
}
});
Run Code Online (Sandbox Code Playgroud)
反应是
{ lastErrorObject: { updatedExisting: true, n: 1 },
value:
{
//original document
},
ok: 1 }
Run Code Online (Sandbox Code Playgroud)
当我直接通过终端去mongoDB并尝试
db.MyCollection.find().pretty();
Run Code Online (Sandbox Code Playgroud)
文档正确更新,它只返回原始文件而不是更新的文件.
被困在这里2个小时,任何帮助表示赞赏
在package.json中 …
对于我的JNLP文件,有一些nativelib信息,如下所示:
<resources os="Windows">
<nativelib href="lib/x264-win.jar" />
</resources>
<resources os="SunOS" arch="sparc">
<nativelib href="lib/x264-SunOS-sparc.jar" />
</resources>
<resources os="SunOS" arch="x86">
<nativelib href="lib/x264-SunOS-x86.jar" />
</resources>
Run Code Online (Sandbox Code Playgroud)
当我更新到JRE7时,无法加载nativelib jar,但JRE6工作正常.
加载nativelib代码如下:
String source = "x264.jar";
ClassLoader cl = Thread.currentThread().getContextClassLoader();
URL url= cl.getResource(source);
Run Code Online (Sandbox Code Playgroud)
"x264.jar"是x264-win.jar中的一个jar,lib/x264-SunOS-sparc.jar或lib/x264-SunOS-x86.jar.
当我使用JRE6加载x264.jar时,它工作正常.但是当我更新到JRE7时,它无法加载x264.jar.
当使用JRE6时,url将是"x264.jar"信息,如jar:http://test.local:8080/JNLP.jar!/x264.jar,但是使用JRE7,url将为null,我发现代码不是加载nativelib"x264.jar"
有没有人发现JRE7无法加载nativelib.jar?是使用Thread.currentThread().getContextClassLoader()加载"x264.jar"的问题?
我正在使用JQuery Mobile,我在从浏览器到iPhone的扩展方面遇到了麻烦.
当我将它加载到浏览器(safari)上时,它会收缩并扩展得很好.但是,当我将它加载到我的iPhone上时,它无法扩展.它允许您在不应该向左和向右滚动.
是否有一些我应该添加的内容,以便在识别出它是移动设备时缩小规模.
这是我目前的HTML.
<head>
<title>Page Title</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://www.domain.com/css/jquery.mobile-1.0b1.min.css" />
<link rel="stylesheet" href="http://www.domain.com/css/base.css" />
<script type="text/javascript" src="http://code.jquery.com/jquery-1.6.1.min.js">
</script>
<script type="text/javascript" src="http://code.jquery.com/mobile/1.0b1/jquery.mobile-1.0b1.min.js"></script>
</head>
<body>
<body>
<!-- Start of first page -->
<div data-role="page">
<div data-role="header">
<div id="header">
<ul>
<li>
<div><a href="logout.php">Logout</a>
</div>
</li>
<li style="float:right;">
<div><a href="new.php">New</a>
</div>
</li>
<h1 align="center">Title</h1>
</ul>
<div id="clear"></div>
</div>
</div>
<!-- /header -->
<div id="stream">
<div id="stream_story">
<ul style="width:100%">
<li>
<img src="" />
</li>
<li style="float:right;">></li>
<li style="width:75%;margin-bottom:10px;margin-left:5px;">Content
<br/><span>Content</span> …
Run Code Online (Sandbox Code Playgroud) 我想添加和清空项目(显示值为空,项目高度保持正常)到Ext.form.ComboBox.我在下面提到了2个链接来配置我的组合框,但它仍然没有显示空项目:
这是我的代码:
this.abcCombo = new Ext.form.ComboBox({
name : 'abcCombo',
hiddenName : 'abcCombo-id',
fieldLabel : "My Combobox",
width : 250,
editable : false,
forceSelection : true,
mode : 'local',
triggerAction : 'all',
valueField : 'id',
displayField : 'fullName',
store : new Ext.data.JsonStore({
fields : ['id', 'fullName']
}),
tpl : '<tpl for="."><div class="x-combo-list-item">{fullName} </div></tpl>'
});
Run Code Online (Sandbox Code Playgroud)
组合框存储的数据将在Ajax请求(即数据项中的3个项)之后加载.组合框只有3项(不是我预期的4项).你对我的问题有任何想法吗?!非常感谢!
我正在使用sencha touch 2.2.1创建sencha web应用程序.在我的应用程序中,我有一个屏幕,其中包含一个容器,我添加了多个面板.单个面板由两个面板组成,顶部面板和内部面板.
在初始化页面时,我调用ajax api来获取容器中每个项目的顶部面板的数据列表.并在顶部面板上单击,我正在调用该项目的api来获取内部面板的数据.在api调用完成后,我将数据渲染到内部面板并使该面板可见.此代码对于单击顶部面板上的容器中的所有项目都是相同的.
"expandAll"顶部还有一个按钮,它将逐个调用for循环中所有项目的api,并为每个内部面板渲染数据.首先,我正在调用一个api然后获得响应,我将存储在屏幕上并在屏幕上呈现然后调用下一个api,就像所有项目一样.
getDetailData:function(params){
var detailStore=Ext.getStore('DetailData');
detailStore.load({
callback:function(data,opt,success) {
detailStore.storeDetailData(data);
_this.onShowDetailData(data);
// now call next api from here until all items data fetched and displayed
}
});
}
Run Code Online (Sandbox Code Playgroud)
在这种情况下,获取所有项目数据并在ui线程上呈现需要更多时间并且应用程序速度变慢.
此外,在渲染数据时,我必须在存储上应用过滤器以在每次渲染数据之前过滤数据.
我想知道如何处理和渲染工作.由于ajax api调用和从服务器获取数据不会花费更多时间,但处理和渲染需要更多时间.
对此有任何建议,
谢谢
我想使用Perl进行Web开发.我试图找出如何安装它,但当我试图获得ActivePerl时,它不会安装在Windows 8上.任何人都可以告诉我如何在Windows 8上安装Perl?我可以使用ActivePerl,Strawberry Perl或任何其他Perl版本,只要它可以在Windows 8上运行.
我遇到了抖动问题。\n我需要在屏幕高度填充数据表。
\n我尝试在 Flex 小部件中添加 dataTable,但没有得到任何更改。
\n当我设置容器的高度时,让我在屏幕按钮处留出一个空白区域
\n谢谢你!我很抱歉我的英语很差
\n这是我的代码:
\nproducts.addAll(Product.getExampleList());\n\nvar table =\n\nContainer(\n child: SingleChildScrollView(\n scrollDirection: Axis.horizontal,\n child:SizedBox(\n child:\n Column(\n children: <Widget>[\n DataTable(\n columns: <DataColumn>[\n DataColumn(\n label: Text("C\xc3\xb3digo")\n ),\n DataColumn(\n label: Text("Precio"),\n numeric: true,\n ),\n DataColumn(\n label: Text("Grupo")\n ),\n DataColumn(\n label: Text("Descripci\xc3\xb3n")\n ),\n ],\n rows:\n products.map<DataRow>((Product element) {\n return DataRow(\n key: Key(element.idProduct.toString()),\n cells: <DataCell>[\n DataCell(Text(element.code)),\n DataCell(Text("\\$ " + element.price.toStringAsFixed(2))),\n DataCell(Text(element.group)),\n DataCell(Text(element.description))\n ],\n );\n }).toList()\n ),\n ],\n )\n ),\n ),\n);\n\n\nreturn Container(\n color: Colors.white24,\n child:\n Column(\n children: <Widget>[\n Container(\n …
Run Code Online (Sandbox Code Playgroud)