ajax发布到url并刷新我的html中的2个数据?

时间:2016-06-24 13:44:01

标签: jquery ajax

首先,我的编码如下:

在我的php中说:$ruser[uuplvlneed] = '500'; $ruser[ulevel] = '5';

在我的html中:

<script>
jQuery(function() {
    jQuery(".viewe{$_G[timestamp]}").click(function() {
        var url = "plugin.php?id=jnship:acdo%26do=viewlevel";
        var decodedUrl = decodeURIComponent(url);
        jQuery.ajax({
            type: "POST",
            url: decodedUrl,
            cache: true,
            success: function(html){
                jQuery("#ulevel").html(html);
            }  
        });
        //code above is work
        //code below i would like to update the exp data in my html, I please help me for correct $ruser[uuplvlneed] data
        var url2 = "plugin.php?id=jnship:acdo%26do=viewexp";
        var decodedUrl2 = decodeURIComponent(url2);
        jQuery.ajax({
            type: "POST",
            url: decodedUrl,
            cache: true,
            success: function(html2){
                /* how to modify here to let me update $ruser[uuplvlneed] data */
            }  
        });
        jQuery("#ulevel").attr('title', 'EXP need: {$ruser[uuplvlneed]}');
    });
});
</script>
<div title="EXP need: {$ruser[uuplvlneed]}" id="ulevel">{$ruser['ulevel']}</div>

以上编码是我从网上学习的,但我不知道如何ajax刷新$ruser[uuplvlneed]数据。

谢谢。

0 个答案:

没有答案