2011-08-01 8 views
0

dynatreeノードのノード をクリックするとjspページまたはinnerHTML(HTMLコンテンツが追加されます)を表示します。DynatreeノードのノードでポートレットonClickをロードする方法

私はコードに示されているようにしようとしていますが、うまくいきません。

助けてください

ありがとう!

// Ajax call 


    $.ajax({ 
    url : TREE_NAV_SERVLET, 
    type: "GET", 
    data: "pName="+node.data.title, 
    dataType : 'text', 
    success : function(responseHTML) { 
    alert("ResponseText :: "+responseHTML);//This is working fine 

    //not able to load this even though path is correct 
    $("[id=content]").attr("src",'/Path/JspToBeLoaded.jsp'); 

    // or The following 

    //This loads the portlet with the with new 
    //content and removes the dynatree which is not required both should be there 

    //$("#content").innerHTML(responseHTML); 
    } 
    }); 



    //Div tag which is the point where I want to display the data/JSP 

    <div id="content"></div> //Response goes here 

答えて

0

1)あなたはいつもあなたは警告がOKであることを意味すると仮定し

2)「それは働いていない」との意味だかを説明すべきである(あなたは)挿入したいHTMLを参照してください、しかし、あなたが行うことができ、正しくHTMLを挿入することはできません。

$.ajax({ 
    url : TREE_NAV_SERVLET, 
    type: "GET", 
    data: "pName="+node.data.title, 
    dataType : 'text', 
    success : function(responseHTML) { 
    alert("ResponseText :: "+responseHTML); 

    $("#content").html(responseHTML); 
    } 
    }); 

    <div id="content"></div>//response goes here 
関連する問題