开发者

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

开发者 https://www.devze.com 2023-03-24 11:53 出处:网络
I want to show a jsp page or the innerHTML(which will add th开发者_如何学JAVAe HTML content) on click on

I want to show a jsp page or the innerHTML(which will add th开发者_如何学JAVAe HTML content) on click on the node of the dynatree node.

I am trying it as shown in the code but its not working out.

Please Help

Thanks!

    // 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)You should always explain what do you mean with "it's not working"

2)assuming that you mean that the alert is ok (you see the html you want to insert), but you can't insert the html correctly, you could do:

 $.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
0

精彩评论

暂无评论...
验证码 换一张
取 消