Как загрузить страницу в портлет onClick на узле узла Dynatree - PullRequest
0 голосов
/ 01 августа 2011

Я хочу показать страницу 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 Ответ

0 голосов
/ 01 августа 2011

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
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...