客户要求实现一个方法
<style>
#tb1 { width:1000px; float: left;}
#tb1 span{ float:left; text-align:center;}
#tb1 span input{ width:20px;}
#tb2 { width:1000px; float: left;}
#tb2 span{ width:32px; border-right:solid 1px #CCC; float:left;}
#tb2 span input{ width:10px;}
</style><div id="tb1">
<span>0<<input type="text" class="qujian" maxlength="5" /></span><span class="add"><a href="javascript:;" id="add">增加</a></span>
</div><div id="tb2">
<span><input type="text" class="shibiema" maxlength="5" /></span><span class="add"></span>
</div>
<script>
$("#add").click(function(){
$("#tb1").find(".add").before("<span><<input class=\"qujian\" type=\"text\" maxlength=\"5\" /></span>");
$("#tb2").find(".add").before("<span><input class=\"shibiema\" type=\"text\" maxlength=\"5\" /></span>");
});
</script>以上是个结构要求客户端填写 INPUT框里的数值,结构: 例如 0 < 30 < 80 < 130 < ∞
5 8 9 160-30之间的值是5 30-80之间的值是8 依此类推如何用JQ获取 这些客户端的值并 把他们的关系写出来一个结构呢? 用JSON吗,还是用数组?希望个位大神 帮小弟 写下结构,我被弄晕了!
完整的数据结构
0 < 30 < ∞ 增加
0 80 设定三级识别码 0 < 30 ≤ 70≤ 120 < ∞ 增加
0 80 95 120设定四级识别码 0 < 30 ≤ 70≤ 120 < ∞ 增加
0 80 95 120
<style>
#tb1 { width:1000px; float: left;}
#tb1 span{ float:left; text-align:center;}
#tb1 span input{ width:20px;}
#tb2 { width:1000px; float: left;}
#tb2 span{ width:32px; border-right:solid 1px #CCC; float:left;}
#tb2 span input{ width:10px;}
</style><div id="tb1">
<span>0<<input type="text" class="qujian" maxlength="5" /></span><span class="add"><a href="javascript:;" id="add">增加</a></span>
</div><div id="tb2">
<span><input type="text" class="shibiema" maxlength="5" /></span><span class="add"></span>
</div>
<script>
$("#add").click(function(){
$("#tb1").find(".add").before("<span><<input class=\"qujian\" type=\"text\" maxlength=\"5\" /></span>");
$("#tb2").find(".add").before("<span><input class=\"shibiema\" type=\"text\" maxlength=\"5\" /></span>");
});
</script>以上是个结构要求客户端填写 INPUT框里的数值,结构: 例如 0 < 30 < 80 < 130 < ∞
5 8 9 160-30之间的值是5 30-80之间的值是8 依此类推如何用JQ获取 这些客户端的值并 把他们的关系写出来一个结构呢? 用JSON吗,还是用数组?希望个位大神 帮小弟 写下结构,我被弄晕了!
完整的数据结构
0 < 30 < ∞ 增加
0 80 设定三级识别码 0 < 30 ≤ 70≤ 120 < ∞ 增加
0 80 95 120设定四级识别码 0 < 30 ≤ 70≤ 120 < ∞ 增加
0 80 95 120
0 < 30 ≤ 70≤ 120 < ∞ 增加
0 80 95 120
这里的两排数字关系就是 一个标志的作用这个标志 是由客户端自定义的相当于 0-30的标志是 0
30-70的标志是80
70-120的标志是95
120以上的标志是120存入数组或者 JSON 后另外的页面需要按照这个规则提取我想问的是 这样的关系 怎么读取和保存可能会有几组这样的数据 -------------------------------------------------------------------------------------
jquery 读取 json 见
http://api.jquery.com/jQuery.parseJSON/