我在下面 <head>
.css不会被缓存,每次刷新都会加载新的.css.但是由于我使用Backbone.js和Require.js,模块仍然被缓存.我还没有使用优化器.我将文件上传到Apache服务器并直接运行html/js.
我怎样才能消除这里的缓存?谢谢.
代码:http://plnkr.co/edit/H2hmEukfjaPL1T4W298O?p =preview
HTML
<!DOCTYPE html>
<html ng-app="plunker">
<head>
<meta charset="utf-8" />
<title>AngularJS Plunker</title>
<link data-require="chosen@*" data-semver="1.0.0" rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/chosen/1.0/chosen.min.css" />
<script>document.write('<base href="' + document.location + '" />');</script>
<link rel="stylesheet" href="style.css" />
<script data-require="jquery@*" data-semver="2.1.1" src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script data-require="angular.js@1.2.x" src="https://code.angularjs.org/1.2.20/angular.js" data-semver="1.2.20"></script>
<script src="chosen.jquery.js"></script>
<script src="chosen.js"></script>
<script src="app.js"></script>
</head>
<body ng-controller="MainCtrl">
<p>Hello {{name}}!</p>
<select chosen class="red" ng-model="bar">
<option>Hi</option>
<option>This is fun</option>
<option>I like Chosen so much</option>
<option>I also like bunny rabbits</option>
<option value=""></option>
</select>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
JS
var app = angular.module('plunker', …
Run Code Online (Sandbox Code Playgroud) 我正在构建使用ARToolkit for Unity3D的AR iOS应用。我的目标是在世界空间模式下创建一个UI,以便当我将手机摄像头指向图像时,它将以3D形式显示UI(例如,选择产品或滚动浏览信息列表等)。
我遵循的指示:
https://github.com/artoolkit/ar6unity-wiki/wiki/Setting-Up-Your-First-ARToolKit-for-Unity-Scene
https://github.com/artoolkit/ar6unity-wiki/wiki/ARToolKit-for-Unity-on-iOS
使UI渲染模式=屏幕空间覆盖没有问题。这意味着无论画布如何移动,UI画布都将“固定”在屏幕上。但是,当我使用World Space时,UI触摸输入事件只是不会触发。这是我的项目的设置:
Marker2是图像检测发生的地方。然后,它应该显示2个多维数据集和1个具有按钮和滚动视图的UI画布(此屏幕快照之外-与此无关紧要)
这是我的画布属性。请注意,我将其放在“默认”层中,以便UI可以显示,并且“渲染模式” =“世界空间”:
好的,我举起了我的图像,它检测并显示了2个多维数据集和一个按钮。但是,单击或触摸按钮均无效。以前在“ UI层”和“屏幕空间覆盖”中,我可以按一下按钮,它可以正常工作(基本上在控制台中输出一些文本-没关系)。
无论如何,我尝试使用一个新项目进行测试,在该项目中我不使用ARToolkit,而只是一个普通的Camera。一切正常。因此,它肯定与ARToolkit中断移动触摸事件有关。
请帮助我指出为什么使用UI World Space在ARToolkit中无法使用移动触摸输入。
我有mysql结果($date_options
)如下
Array (
[0] => stdClass Object (
[id] => 4
[start_date] => 2010-09-29
)
[1] => stdClass Object (
[id] => 13
[start_date] => 2010-10-06
)
)
Run Code Online (Sandbox Code Playgroud)
如果存在某些值,我需要能够在"id"字段中搜索.我尝试过这个并没有用:
array_search($event_id, $date_options, true)
Run Code Online (Sandbox Code Playgroud)
$event_id
是有id值.我只想查看id而不是start_date
怎么解决这个?
谢谢
这是我跑步时得到的 npm install contextify
npm http GET https://registry.npmjs.org/contextify
npm http 304 https://registry.npmjs.org/contextify
npm http GET https://registry.npmjs.org/bindings
npm http 304 https://registry.npmjs.org/bindings
> contextify@0.1.3 install C:\node_modules\myfolder\node_modules\contextify
> node-gyp rebuild
C:\node_modules\myfolder\node_modules\contextify>node "C:\Program Files\nodejs\node_
modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebui
ld
python: can't open file 'C:\Users\Username\.node-gyp\0.8.16\tools\gyp\gyp': [Errn
o 2] No such file or directory
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 2
gyp ERR! stack at ChildProcess.onCpExit (C:\Program Files\nodejs\node_module
s\npm\node_modules\node-gyp\lib\configure.js:395:16)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:99:17)
gyp ERR! stack at Process._handle.onexit (child_process.js:678:10) …
Run Code Online (Sandbox Code Playgroud) 这是一个基本问题,但我只是对一种优雅的做事方式感到好奇(我已经有了解决方法).我有以下代码以空var a
作为JSON数组开始.然后我想在concat
以后将更多JSON对象数组放入其中:
var a = [{}];
a = a.concat([{"a":"b1"},{"a":"b2"}]);
a.splice(0,1); // This does not work to remove index 0 of undefined
console.log(a[0].a + " " + a[1].a + " " + a[2].a);
Run Code Online (Sandbox Code Playgroud)
问题在于a
声明时,它已经undefined
在索引0中出现了.我可以重新生成整个数组以删除所有undefined
使用push.apply()
但这似乎是不必要的开销.看到:
Javascript:如何根据项属性值删除数组项(JSON对象)?
两个问题:
concat
覆盖索引0concat
?concat
不声明的情况下使用a = [{}]
?