[英]Need to show popup page when clicked the link
//function
function maps(url) {
window.open(url, "_blank", "toolbar=yes, scrollbars=yes, resizable=yes, top=500, left=500,width=400, height=400");
}
php page php页面
$display.= "<td><a href='#' onclick='maps('google.com')'>"visit "</a></td>";
I have checked the function without passing url variable and it works but when i used url varibale its not working. 我已经检查了该函数而未通过url变量,并且它可以工作,但是当我使用url varibale时,它无法工作。 I want this function to use everywhere.
我希望此功能可在任何地方使用。
help me 帮我
try this once.. 尝试一次
change 更改
onclick='maps('google.com')'
to
onclick='maps(\'google.com\')'
There is problem in concatenate the url string inside function. 连接函数内部的url字符串时出现问题。 Try to give it inside
\\"
. 尝试将其放在
\\"
。
And give absolute url
as parameter. 并给出
absolute url
作为参数。
$display = "<td><a href='#' onclick='maps(\"http://www.google.com\");'>Visit</a></td>";
您以错误的方式连接字符串。使用下面的代码将起作用
$display= "<td><a href='#' onclick=\"maps('google.com')\">visit</a></td>";
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.