【问题标题】:change the value of button in ajax when json is return some value当json返回一些值时更改ajax中按钮的值
【发布时间】:2013-10-26 04:40:39
【问题描述】:

我正在使用 javascript 和 jquery 编写简单的 ajax 代码并以 json 格式获取数据,如果 json 为空,我想更改按钮值。

【问题讨论】:

  • 如果json数据不为空,我想你只是想改变按钮的值
  • 很简单,发问题前先去社区搜索一下。

标签: javascript ajax json


【解决方案1】:

数据不为空条件

success: function(data){
    if(data!=””)
        document.getElementByInnerHtml('ButtonId').value=”newValue”;
    }//end success

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-07-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多