English 中文(简体)
• 如何从Ajaxjson呼吁中收回价值?
原标题:How to return a value from an ajax json call?

我已经研究过过去的问题,以回答这个问题,但如果我错过了,确实存在,请原谅我。

我试图做的是:

一旦点击一个检查箱,就执行了一个功能。

$(".check_group").live( click , function(){
        var valueid = $(this).val();
                    countThem();
                    if($(this).is(":checked")){
                     blah blah blah.......

职能如下:

function countThem(){

        if($( input#currentGroup ).val()){

        $.ajax({
            url: "controlBrief.php?ajah=count_group_establishments", 
            dataType: "json", 
            success: function(data){
                $("#message_area").html("There are "+data.totalNumber+" establishments already in this group. <BR/>");
                $("#message_area").slideDown();


            }
        });
        }

    }

整个事情都取得了成功,因此,在阿贾克斯呼吁或从我的营地网页上穿戴json时,没有任何问题。

数据:总吨数变量需要再回来,并在另一功能或某一活动中使用的变量中加以节省。 而这正是我 st和问大呼的时候?

仅在一个月前,JSON、Ajax和JQuery就进入我的词汇,因此,你可以向我指明这一方向是巨大的。

问题回答

您可使用

您可以使用一般美元法,而不是按美元或美元计算。

 $.get("controlBrief.php",{"ajah":"count_group_establishments"},function(data)
 {
        $("#message_area").html("There are "+data.totalNumber+" establishments already in this group.");
        $("#message_area").slideDown();
 },"json");

• 如何从 j子成功功能中恢复一阵列? 这与你的问题非常相似。 问题在于归还一个阵列,但您的单一<代码>数据。





相关问题
ajax login using httpRequest?

I am trying to develop my login script to give feedback to the user if the login is valid or not. Basically if it isn t correct a div box will show saying its wrong, if its correct it will show its ...

Virtual Tour using sketch up, ajax, flash technologies

I want to know if there are existing technology that make your 3d models in sketch into virtual tours, using either Ajax or Flash for web presentation. If there s none, which will be a good approach ...

How can i update div continuously

I have asp.net application where i have a div which showing the value from other site. The value of that site is changing continuously. I want that my div will automatically update in some interval ...

热门标签