我在javascript中有一个数组,它有点长,如图所示
var array = [
{min: 0, max: 5000, init: 155.00, plus: 0},
{min: 5001, max: 20000, init: 171.00, plus: 0},
{min: 20001, max: 40000, init: 188.00, plus: 0},
{min: 40001, max: 50000, init: 264.00, plus: 0},
{min: 50001, max: 60000, init: 341.50, plus: 0},
{min: 60001, max: 70000, init: 419.00, plus: 0},
{min: 70001, max: 80000, init: 496.50, plus: 0},
{min: 80001, max: 90000, init: 574.00, plus: 0},
{min: 90001, max: 100000, init: 651.50, plus: 0},
{min: 100001, max: 110000, init: 729.00, plus: 0},
{min: 110001, max: 120000, init: 806.50, plus: 0},
{min: 120001, max: 130000, init: 884.00, plus: 0},
{min: 130001, max: 140000, init: 961.50, plus: 0},
{min: 140001, max: 150000, init: 1039.00, plus: 0},
{min: 150001, max: 160000, init: 1116.50, plus: 0},
{min: 160001, max: 170000, init: 1194.00, plus: 0},
{min: 170001, max: 180000, init: 1271.50, plus: 0},
{min: 180001, max: 190000, init: 1349.00, plus: 0},
{min: 190001, max: 200000, init: 1426.50, plus: 0},
{min: 200001, max: 210000, init: 1504.00, plus: 0},
{min: 210001, max: 220000, init: 1581.50, plus: 0},
{min: 220001, max: 230000, init: 1659.00, plus: 0},
{min: 230001, max: 240000, init: 1736.50, plus: 0},
{min: 240001, max: 250000, init: 1814.00, plus: 0},
{min: 250001, max: 260000, init: 1891.50, plus: 0},
{min: 260001, max: 270000, init: 1969.00, plus: 0},
{min: 270001, max: 280000, init: 2046.50, plus: 0},
{min: 280001, max: 290000, init: 2124.00, plus: 0},
{min: 290001, max: 300000, init: 2201.50, plus: 0},
{min: 300001, max: 310000, init: 2279.00, plus: 0},
{min: 310001, max: 320000, init: 2356.50, plus: 0},
{min: 320001, max: 330000, init: 2434.00, plus: 0},
{min: 330001, max: 340000, init: 2511.50, plus: 0},
{min: 340001, max: 350000, init: 2589.00, plus: 0},
{min: 350001, max: 360000, init: 2666.50, plus: 0},
{min: 360001, max: 370000, init: 2744.00, plus: 0},
{min: 370001, max: 380000, init: 2821.50, plus: 0},
{min: 380001, max: 390000, init: 2899.00, plus: 0},
{min: 390001, max: 400000, init: 2976.50, plus: 0},
{min: 400001, max: 410000, init: 3054.00, plus: 0},
{min: 410001, max: 420000, init: 3131.50, plus: 0},
{min: 420001, max: 430000, init: 3209.00, plus: 0},
{min: 430001, max: 440000, init: 3286.50, plus: 0},
{min: 440001, max: 450000, init: 3364.00, plus: 0},
{min: 450001, max: 460000, init: 3441.50, plus: 0},
{min: 460001, max: 470000, init: 3519.00, plus: 0},
{min: 470001, max: 480000, init: 3596.50, plus: 0},
{min: 480001, max: 490000, init: 3674.00, plus: 0},
{min: 490001, max: 500000, init: 3751.50, plus: 0},
{min: 500001, max: 510000, init: 3829.00, plus: 0},
{min: 510001, max: 520000, init: 3906.50, plus: 0},
{min: 520001, max: 530000, init: 3984.00, plus: 0},
{min: 530001, max: 540000, init: 4061.50, plus: 0},
{min: 540001, max: 550000, init: 4139.00, plus: 0},
{min: 550001, max: 560000, init: 4216.50, plus: 0},
{min: 560001, max: 570000, init: 4294.00, plus: 0},
{min: 570001, max: 580000, init: 4371.50, plus: 0},
{min: 580001, max: 590000, init: 4449.00, plus: 0},
{min: 590001, max: 600000, init: 4526.50, plus: 0},
{min: 600001, max: 610000, init: 4604.00, plus: 0},
{min: 610001, max: 620000, init: 4681.50, plus: 0},
{min: 620001, max: 630000, init: 4759.00, plus: 0},
{min: 630001, max: 640000, init: 4836.50, plus: 0},
{min: 640001, max: 650000, init: 4914.00, plus: 0},
{min: 650001, max: 660000, init: 4991.50, plus: 0},
{min: 660001, max: 670000, init: 5069.00, plus: 0},
{min: 670001, max: 680000, init: 5146.50, plus: 0},
{min: 680001, max: 690000, init: 5224.00, plus: 0},
{min: 690001, max: 700000, init: 5301.50, plus: 0},
{min: 700001, max: 710000, init: 5379.00, plus: 0},
{min: 710001, max: 720000, init: 5456.50, plus: 0},
{min: 720001, max: 730000, init: 5534.00, plus: 0},
{min: 730001, max: 740000, init: 5611.50, plus: 0},
{min: 740001, max: 750000, init: 5689.00, plus: 0},
{min: 750001, max: 760000, init: 5766.50, plus: 0},
{min: 760001, max: 770000, init: 5844.00, plus: 0},
{min: 770001, max: 780000, init: 5921.50, plus: 0},
{min: 780001, max: 790000, init: 5999.00, plus: 0},
{min: 790001, max: 800000, init: 6076.50, plus: 0},
{min: 800001, max: 810000, init: 6154.00, plus: 0},
{min: 810001, max: 820000, init: 6231.50, plus: 0},
{min: 820001, max: 830000, init: 6309.00, plus: 0},
{min: 830001, max: 840000, init: 6386.50, plus: 0},
{min: 840001, max: 850000, init: 6464.00, plus: 0},
{min: 850001, max: 860000, init: 6541.50, plus: 0},
{min: 860001, max: 870000, init: 6619.00, plus: 0},
{min: 870001, max: 880000, init: 6696.50, plus: 0},
{min: 880001, max: 890000, init: 6774.00, plus: 0},
{min: 890001, max: 900000, init: 6851.50, plus: 0},
{min: 900001, max: 910000, init: 6929.00, plus: 0},
{min: 910001, max: 920000, init: 7006.50, plus: 0},
{min: 920001, max: 930000, init: 7084.00, plus: 0},
{min: 930001, max: 940000, init: 7161.50, plus: 0},
{min: 940001, max: 950000, init: 7239.00, plus: 0},
{min: 950001, max: 960000, init: 7316.50, plus: 0},
{min: 960001, max: 970000, init: 7394.00, plus: 0},
{min: 970001, max: 980000, init: 7471.50, plus: 0},
{min: 980001, max: 990000, init: 7549.00, plus: 0},
{min: 990001, max: 1000000, init: 7626.50, plus: 0},
{min: 1000001, max: 1010000, init: 7704.00, plus: 0},
{min: 1010001, max: 1020000, init: 7781.50, plus: 0},
{min: 1020001, max: 1030000, init: 7859.00, plus: 0},
{min: 1030001, max: 1040000, init: 7936.50, plus: 0},
{min: 1040001, max: 1050000, init: 8014.00, plus: 0},
{min: 1050001, max: 1060000, init: 8091.50, plus: 0},
{min: 1060001, max: THRESHOLD_INF, init: 8169.00, plus: 0}
];
我需要的是把这个数据到一个android项目。因此,我所知道的是分别键入每个json对象,并将这些对象添加到数组中。会是这样的
`JSONArray array=new JSONArray();
JSONObject one=new JSONObject();
JSONObject two=new JSONObject();
JSONObject three=new JSONObject();
...
array.put(one);
array.put(two);
array.put(three);//and so on..
JSONArray jArray = new JSONArray(array.toString());
for (int i = 0; i < jArray.length(); i++) {
JSONObject json = jArray.getJSONObject(i);
String min = json.getString("min");
String max = json.getString("max");
//all other data will fetch here
array.put(json);
}
尝试以下代码
我正在尝试使用手指打印在我的客户端,并得到了这段代码作为一个更大的代码的一部分。 正如您所看到的,散列是显而易见的。你能告诉我如何或什么实现使用,以便我可以隐藏或任何可以掩盖散列=5382。谢谢你。
问题内容: 我正在使用jQueryUI ProgressBar向用户显示他们已使用了多少允许的文件存储。百分比是在后台代码中计算的,应该传递给Javascript。 Aspx代码 背后的代码 似乎无法从隐藏字段中获取百分比数字。任何帮助,将不胜感激。 问题答案: 由于您的隐藏字段是服务器控件,因此可能是ID生成的不是(可能类似于) 您可能需要将生成的客户端ID应用于javascript 或使用另一
问题内容: 我是Angular的新手,正在尝试ng-options。在我的控制器中,我有: 在我的模板中,我有: 根据视图,我想隐藏“读取”或“写入”。所以在我的控制器中,我还有另一个标志来指示它是什么视图。在使用ng- options之前,我有一个普通的select下拉列表,并做了如下操作: 有没有办法用ng-options做到这一点?谢谢。 问题答案: 您可以在ngOptions表达式中使用过
问题内容: 我正在尝试一些非常基本的东西:我列出了5个按钮。它们位于FlowLayout中,通常的想法是,一旦我单击一个,它将消失,而其他应该相应地重新排序。 现在,如果我调用setVisible(false),该按钮将变为不可见,但它仍在Layoutmanager中占据它的空间。 有什么办法可以在隐藏它的同时将Button保留在JPanel中,以便它不会被Layout拾取? 更新:: 感谢您提供
有一种方法可以将特定的数字从一个数组复制到另一个数组吗? 例如: 我有一个数组 ,我想将奇数和偶数复制到不同的数组中。因此,结果应该是