$(document).ready(function () {
        alert("adasd"); $.ajax({
            type: "POST",
            url: "index.ashx", //调用的url
            dataType: 'json',   //返回Json类型                    
            success: function (data) {
                $.each(data, function (i, loan) {
                    $("#test").html(loan.productName);
                   //我要讲json的值,给div内的元素赋值
                }
                );
            }   //回调函数,data返回        });
       
    });<div class="conn" id="test">
<img src="images/pic-index-3.jpg">
<h2><a href="#"></a></h2>
<span><font></font>。</span>
<a href="#" class="cp"><img src="images/pic-index-7.jpg"></a>
</div>

<div class="conn">
<img src="images/pic-index-4.jpg">
<h2><a href="#"></a></h2>
<span><font></font></span>
<a href="#" class="cp"><img src="images/pic-index-7.jpg"></a>
</div>

jQuery AjaxjQueryHTML

解决方案 »

  1.   

    我要讲json的值,赋值到下面的代码块里的div中元素,如A标签,Header,span等;
      

  2.   

    <div class="conn" id="test">
    里面那么多标签谁知道你要赋给哪个??
      

  3.   

    Jquery有api文档,对照着看,在chrome或者firebug的环境下调试,一步一步下来没啥难点。
    http://julying.com/jQuery-1.6-api/
      

  4.   

    <img>标签的src,a标签里的href,span的text.都赋值
      

  5.   

    写个function 负值+添加div到你所要的节点。对dom的操作
      

  6.   

    $("#test img").attr("src",data.src);
    $("#test a").attr("href",data.href);
    $("#test span font").text(data.text);
      

  7.   

    for循环 json
    拼接成html 然后塞给div不会就学~ 1~3天的事情