特色栏目

ASP源码

PHP源码

.NET源码

JSP源码

游戏频道
专题合集
关闭菜单
首页> Ajax教程> 如何在jsp中使用 jquery 的 ajax 功能

如何在jsp中使用 jquery 的 ajax 功能

时间:2009-07-06 16:38:02 作者:互联网

$(document).ready(function() {   
    $("a").click(function() {
        $("#decimal").val('这是一个例子');
        $("#inputtext").val('控制text');

    });

/*
    $("a").click(function() {
        alert("Hello world!");
    });
*/
   

});  

function convertToDecimal(){
   $.ajax({
        type: "GET",
        url: "/jqueryjsp/response",
        data: "key=" + $("#key").val(),
        dataType: "html",
        success: function(xml){
        //alert( "keypress code: " + $("key",xml).text() );
/*
        var decimal = do***ent.getElementById('decimal');
        de***al.value = $("key",xml).text();
        //等价于上面的代码。
        $("#decimal").val($("key",xml).text());
*/
        $("#decimal").val($("key",xml).text());

        $("#rating").html("按键代码:" + $("key",xml).text());
        }   
   })
    clear();
  }

  function clear(){
    var key = do***ent.getElementById("key");
  
    ke***alue="";
    // alert( "keypress code: " + $(this).html() );
  }


jquery 在 php 中使用的例子很多,但是没有 jsp 的,

我修改了ajax  on java 中的第三章的例子,应用了jquery实现了ajax

相关文章 最新文章

相关应用

热门文章

猜你喜欢

返回顶部