如何在portlet中加载页面单击Dynatree节点的节点
How to load a page in portlet onClick on the node of Dynatree node
我想在点击时显示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
相关文章:
- js循环遍历单击的元素子节点
- 如果某个值在另一个节点中,我如何每秒自动单击一个链接
- 在带有 标记的树节点上以编程方式触发单击事件
- 检测单击子节点并发送槽事件处理程序
- AlloyUI:对节点做出反应 - 在图表生成器中单击事件
- 在d3.js中单击URL为的节点时无法打开弹出窗口
- 动态地将单击的节点作为加载节点的父节点 - jsTree
- 从 SVG 外部的按钮单击 D3 中的节点
- 关闭菜单,单击带有事件侦听器和父节点的正文
- 在 vis 中访问节点数据.js单击处理程序
- 单击时在文本之间插入图像节点
- JSTREE - 重命名功能问题(单击重命名后,节点上的文本输入不接受更改)
- 使用 vis.js 使节点可单击
- 通过单击父名称 jsTree 获取子节点
- 花式树:在右键单击上下文菜单中获取节点
- 在 CytoScape.js 中单击连接的节点时更改边缘线颜色
- 在 React 应用程序中单击除特定 DOM 节点之外的任何内容上的事件
- 如何触发子节点单击事件
- Arbor Js-节点单击
- 防止在单击特定子节点时触发父节点单击