日期:2014-05-16  浏览次数:20304 次

JQ应用的一个逻辑写法,请大神帮忙看看
客户要求实现一个方法

HTML code

<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&lt;<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>&lt;<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 16



0-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


------解决方案--------------------
上面的数和下面的数有什么关系?
------解决方案--------------------
没看懂
------解决方案--------------------
没看懂too
------解决方案--------------------
同样看不懂

程序逻辑是建立在实际逻辑上的。
都不知道,你那些数怎么来的,有什么逻辑关系。。。。。


------解决方案--------------------
非常不理解。
jquery 读取 json 见
http://api.jquery.com/jQuery.parseJSON/