Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/73.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
jQuery问题无法处理超链接_Jquery - Fatal编程技术网

jQuery问题无法处理超链接

jQuery问题无法处理超链接,jquery,Jquery,指向转发jsp的链接不起作用 不工作时出现问题-我需要帮助: $("<td>").addClass("labelSearchData") .append("<a>") .attr("href", "/mng/admin/DetailCustomLabelSummary") .text(checkValue(node, "label")) .appendTo(trow); $(“”).addClass(“labelSearchData”)

指向转发jsp的链接不起作用

不工作时出现问题-我需要帮助:

$("<td>").addClass("labelSearchData")
    .append("<a>")
    .attr("href", "/mng/admin/DetailCustomLabelSummary")
    .text(checkValue(node, "label"))
    .appendTo(trow);
$(“”).addClass(“labelSearchData”)
.附加(“”)
.attr(“href”,“/mng/admin/DetailCustomLabelSummary”)
.text(检查值(节点,“标签”))
.附录(trow);
原始代码:

$("<td>").addClass("labelSearchData")
    .text(checkValue(node, "label"))
    .appendTo(trow);
$(“”).addClass(“labelSearchData”)
.text(检查值(节点,“标签”))
.附录(trow);
.append()
返回附加到的对象,而不是要附加的对象。因此,您的代码正在调用
上的
.attr
.text
,而不是正在添加的
。当您调用
.text()
时,它将替换附加的
。尝试:

$("<td>").addClass("labelSearchData")
    .append($("<a>", {
        href: "/mng/admin/DetailCustomLabelSummary",
        text: checkValue(node, "label")
    }))
    .appendTo(trow);
$(“”).addClass(“labelSearchData”)
.append($(“”){
href:“/mng/admin/DetailCustomLabelSummary”,
文本:检查值(节点,“标签”)
}))
.附录(trow);

请注意,$(“”)可能没有选择任何东西,因为append(“”)也没有做任何事情。如果需要弹出窗口,请将
目标:“\u blank”
添加到
的属性中