IQ绿色电脑总站 IQ绿色下载站 IQ电脑图片 IQ丁香鱼电脑站
网站首页 | 网络编程 | 站长学院 | 网页制作 | 图形图像 | 操作系统 | 冲浪宝典 | 软件教程 | 网络办公 | 邮件系统 | 网络安全 | 电脑故障 | 访客留言 | 内容搜索
>首页 -> 网络编程 -> Ajax教程

TOP

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

$(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 = document.getElementById('decimal');
        decimal.value = $("key",xml).text();
        //等价于上面的代码。
        $("#decimal").val($("key",xml).text());
*/
        $("#decimal").val($("key",xml).text());

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

  function clear(){
    var key = document.getElementById("key");
  
    key.value="";
    // alert( "keypress code: " + $(this).html() );
  }


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

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

[上一篇]ASP.NET AJAX中的非同步PageMetho.. [下一篇]关于IE缓存和AJAX的一点思考和疑问

评论

称  呼:
内  容:

精彩文章地带

相关栏目

最新文章

热门文章

推荐文章