我在此路径上成功创建了一个带有ripple仿真器的文件:
fullPath: "/myAppFolder/myFile.txt"
Run Code Online (Sandbox Code Playgroud)
这是代码:
filesystem.root.getDirectory(
"myAppFolder",
{ create: true, exclusive: false },
function(dir) {
dir.getFile(
"myFile.txt",
{ create: true, exclusive: true },
function(file) {
console.log(file);
},
function(error) {
console.log("error create file: " + error.code + ":" + error.message);
}
);
},
function(error) {
console.log("error create dir: " + error.code + ":" + error.message);
}
);
Run Code Online (Sandbox Code Playgroud)
另外我在哪里可以看到这个文件?它在硬盘上吗?
我想将Text设置为我的应用程序的TextView(lication).这是我使用的代码:
TextView lonTextView = (TextView) findViewById(R.id.textViewLonWert);
lonTextView.setText(longitude.toString());
Run Code Online (Sandbox Code Playgroud)
实际上它工作,但以前的文本仍然显示!例如,4覆盖8(您不能再读取文本).
我有一个Activity开始服务.然后将LocalBroadcastReceiver注册到Activity.该服务将位置对象永久地发送到活动.从我获得的位置,例如经度,并希望用新的经度更新文本视图(仅包含经度).
如果有人有想法解决这个问题,我会很高兴.
更新:完整的代码很长,所以这里是相关的片段:
TrackingActivity.java
public class TrackingActivity extends Activity {
// GPSTracker class
GPSTracker gps;
public String filename;
/* Um eigene Position anzuzeigen */
ArrayList<OverlayItem> overlayItemArray;
protected MapView mapView;
protected MapController mapController;
public Boolean isPause;
public Boolean isTracking;
public MyLocationOverlay myLocationOverlay;
PathOverlay myPath;
List<GeoPoint> path;
public BroadcastReceiver screenReceiver;
/* Textviews setzen */
TextView lonTextView;
TextView latTextView;
TextView altTextView;
TextView accTextView;
// Initiating Menu XML file (menu.xml)
/*@Override
public boolean onCreateOptionsMenu(Menu menu)
{ …Run Code Online (Sandbox Code Playgroud) 当我在 safari 中点击地址栏时,我有一个“经常访问”部分(德语:häufig besucht),其中显示了我经常访问的网站的徽标。然而,其中一些,也是我自己的网站,显示有标准图标。我将向我网站的用户显示一个自定义图标。我需要做什么?
这是一个示例(红色标记):

我有以下代码片段:
if([]) {
console.log("first is true");
}
Run Code Online (Sandbox Code Playgroud)
该console说,first is true该装置[]是真实的。现在我想知道为什么:
if([] == true) {
console.log("second is true");
}
Run Code Online (Sandbox Code Playgroud)
和这个:
if([] === true) {
console.log("third is true");
}
Run Code Online (Sandbox Code Playgroud)
不是true。如果控制台登录first is true了第一个代码段,那意味着[]应该为真,对吗?那么为什么后两个比较失败?这是小提琴。
我试图用我的选择框(http://silviomoreto.github.io/bootstrap-select/)设置样式
data-style="btn-info"
Run Code Online (Sandbox Code Playgroud)
但它没有效果.这是整个代码:
<select class="selectpicker" data-width="25%" data-style="btn-info">
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6</option>
<option>7</option>
<option>8</option>
<option>9</option>
<option>10</option>
</select>
Run Code Online (Sandbox Code Playgroud)
数据宽度也不起作用.有人有想法吗?这是我的测试网站:http://testshop.mein-sporttagebuch.de/produkte/details/0001 .您将在右侧找到相关的选择框.提前致谢!
我的网站结构如下:
<html>
<iframe>
<iframe>
</iframe>
</iframe>
<html>
Run Code Online (Sandbox Code Playgroud)
我正在编写最内在的部分iframe。现在我想确定height浏览器窗口的可用程度(menubar在可能的toolbars下开始并在可能的s之前结束)。
我有IE9并尝试过类似的东西:
window.innerHeight
Run Code Online (Sandbox Code Playgroud)
(结果未定义)和
window.parent.document.body.clientHeight
Run Code Online (Sandbox Code Playgroud)
(不是我预期的高度)。
我如何获得height?提前谢谢。
要循环访问javascript对象,您可以执行此操作
for(key in object){
// sth. great...
}
Run Code Online (Sandbox Code Playgroud)
是否可以通过对象循环使用此方法?提前致谢.
我创建了一个array:
myarray = new Array();
myarray['test_a'] = "test a";
myarray['test_b'] = "test b";
Run Code Online (Sandbox Code Playgroud)
现在我想删除索引为"test_b"的条目.我试过这种方式:
var del = "test_b";
for(key in myarray){
if(key==del){
myarray.splice(key,1);
}
}
Run Code Online (Sandbox Code Playgroud)
但它不起作用.没错.我刚刚在firebug中检查了数组的条目,并提到"test_b"仍然存在.怎么了?感谢帮助.
我正在使用此代码打开一个新选项卡:
<a href="javascript:window.open('https://example.com','_blank')">linktext</a>
Run Code Online (Sandbox Code Playgroud)
新页面也会在新选项卡中加载,但在源页面上显示的是新页面[object]而不是链接。怎么了?
我不想使用
<a href="https://example.com" target="_blank")">linktext</a>
Run Code Online (Sandbox Code Playgroud)
因为我生成了一个链接列表,并且每个链接的目标页面调用方式都不同。对我来说最灵活的方法是使用给定语法。
编辑:这是生成的链接列表:
<a href="javascript:window.open('https://example.com','_blank')">linktext 1</a>
<a href="javascript:jsfunc1(param1)">linktext 2</a>
<a href="javascript:jsfunc2(param2,param3)">linktext 3</a>
Run Code Online (Sandbox Code Playgroud)
href 属性已生成。我从桌子上拿了一个。