如何在portlet中加载页面单击Dynatree节点的节点

How to load a page in portlet onClick on the node of Dynatree node

本文关键字:节点 单击 Dynatree 加载 portlet      更新时间:2023-09-26

我想在点击时显示jsp页面或innerHTML(它将添加HTML内容)dynatree节点的节点。

我正在尝试它显示在代码中,但它不工作。

请帮

谢谢!

    // 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

1)你应该总是解释你所说的"it's not working"是什么意思

2)假设您的意思是警报是ok的(您看到了要插入的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