2011-08-01 6 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) 당신은 항상 당신이 경고가 괜찮다는 것을 의미한다고 가정

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 
관련 문제