这种方法有什么问题?

时间:2012-05-04 17:24:35

标签: javascript jquery html ajax http-get

我正在执行这个功能,我不知道我错过了什么但是当HELLO充满HTML时var BYE是空的,怎么会发生这种情况?

$.get(path+'productor/masnotas.jsp', function(data){
                    var hello = data; 
                    var bye = $(data).find("#columna1");
                            $("#columnauno").append($(data).find("#columna1"));
                                    },'html');

有人可以帮帮我吗?

编辑:对不起我很急,这里是数据内容的一部分,然后是更多的HTML,由另一个名为#columna2的div组成,在#columna1之外。我希望使用一个HTML / JSP,在更新页面时选择并将每个内容放在Web的每一列中:

<html>
<!-- Primera Columna --> 
<div class="span-12 first" id="columna1">
<br>
   <div class="caja">
    <b>Cambios en las denuncias por Self</b>
    <p style="text-align: justify;">
       Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet Lorem ipsum dolor sit ametLorem ipsum dolor sit ametLorem ipsum dolor sit ametLorem ipsum dolor sit ametLorem ipsum dolor sit ametLorem ipsum dolor sit ametLorem ipsum dolor sit amet
       <a href="${self.monitor.basePath}siniestro/ayudaDenuncia.jsp" target="_blank">Leer más</a>
     </p>
    </div>
    <br>
    <div class="caja">
    <img border="0" align="left" src="${self.monitor.basePath}images/aapas.jpg"/>
    <b>Lorem ipsum dolor sit amet</b>
    <p style="text-align: justify;"> 
     Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis condimentum purus vel diam dictum non pharetra dolor vulputate. Aenean sed sapien leo, sed laoreet risus. Duis dictum volutpat imperdiet. Donec eros nibh, accumsan condimentum euismod laoreet, auctor vel lacus. Pellentesque felis tortor, laoreet eget varius eget, iaculis vitae turpis. Cras lobortis malesuada erat, nec sodales tellus porttitor eu. Vestibulum porttitor, neque vel aliquet porttitor, est tortor commodo magna, id faucibus orci massa at velit. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse arcu quam, volutpat ut ullamcorper in, laoreet eget diam. Pellentesque in massa nec massa dapibus vehicula. Sed nec lectus nisi, sed pharetra est. Ut leo metus, sagittis non blandit ac, adipiscing eu leo. <a href="#" target="_blank">ver nota completa</a>
     </p>
    </div>
    <br>

路径是系统路径,basepath = $ {self.monitor.basePath} * 创建的VARS用于测试目的 *

1 个答案:

答案 0 :(得分:1)

不幸的是,在这种情况下,查找不起作用,因为我怀疑#columna1不是后代。请尝试以下方法。

var bye = $('<div/>').html( data ).find('#columna1');