ajax实现数据查询(不通过靠山)

ajax实现数据查询(不通过后台)
这是jsp页面的按钮的实现
<input type="button" value="显示未拨打号码" onclick="query(this)" id="queryButton"/>

ajax实现数据查询(不通过靠山)


现在想要实现点击这个 显示未拨打号码 按钮,拨打情况这一列只显示“未拨打”的数据
这是我js写的代码,总是实现不了

function query(obj)
{
if(obj.value=="显示未拨打号码")
{
queryAll();
obj.value="显示全部";
    }
    else
    {
        queryUnCall();
        obj.value="显示未拨打号码";
    }
}

//查询未拨打的号码
function queryAll()
{
//alert("显示未拨打");
$.ajax({
        url:path+"/editor/queryPersonalSource/",
        data:document.getElementById("tder").value ,
   dataType:'json',
   type:"post",
   success:function(data)
   {
                var obj = eval(data);
                alert("显示未拨打");
                document.getElementById("tder").value;
            }
        });
}
 
//查询所有
function queryUnCall()
{
alert("显示全部");
}
------解决思路----------------------
引用:
Quote: 引用:

Quote: 引用:

Quote: 引用:

不走后台   那就把数据存到前台     在把数据放到页面的时候    把未拨打和已拨打的name区分开     然后通过js显示隐藏     但是这似乎跟你说的ajax 没啥关系    


请问应该怎么样通过js来隐藏



隐藏的话可以通过div的属性隐藏  但是这个跟你说的ajax毫无关系。  ajax局部刷新  就要去后台的  你不走后台  要ajax干嘛  直接js操作2个隐藏区域进行切换   <div display="none/block" ></div>



能麻烦写一下具体的代码么,不是很会写
这是jsp页面的 拨打情况 的那一列的代码
<td>${informationSources.er}
         <c:if test="${informationSources.cishu == 0}">未拨打</c:if>
     <c:if test="${informationSources.cishu > 0}">(${informationSources.cishu})</c:if>
     <input type="hidden" value="<c:if test="${informationSources.cishu == 0}">未拨打</c:if>" id="tder${informationSources.INS_ID}" name = "wei" />
     <input type="hidden" value="<c:if test="${informationSources.cishu > 0}">(${informationSources.cishu})</c:if>" id="tder1" name = "yi" />
     </td>



function change(){
var row = document.getElementsByName("yida");
for( var i = 0; i < row.length; i++ ){
row[i].style.display = "block";
}
}

    <table>
     <tr>
     <td>1</td>
     </tr>
     <tr name="yida" style="display:none;">
     <td>2</td>
     </tr>
     <tr name="yida" style="display:none;" >
     <td>3</td>
     </tr>
    </table>
    <input type="button" onclick="change()" />


类似这种代码吧   通过name区分是否拨打过    通过js隐藏显示数据   name的值通过你的${informationSources.cishu > 0} 设置两种名字 拨打过和没打过的    说的很清楚了吧   我也是第一次教人啊  望其他大神有更好的方法也能说一说