javascript 无法接受视图中的输出重写
我需要显示节点标题、节点编辑和节点 url。当用户点击节点 url 时,意味着它在弹出窗口中打开,因此我尝试在视图中重写该 url 字段的输出。首先,我创建一个名为的新 js 文件popup.js 包含到该文件内的 theme.info 我粘贴以下代码
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "','toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=1000,height=250,left = 12,top = 259');");
然后我移动到输出重写部分添加以下代码
<A HREF="javascript:popUp('[url]')">view</A>
但是该 url 未打开弹出窗口。是否有任何我错过的事情。任何人指出我的错误。
谢谢......
I need to display the node title,node edit and node url.when user hits the node url means its open in popup window so for that i try to rewrite the output of that url field in views.First i create a new js file called popup.js include to via theme.info inside that file i paste the following code
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "','toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=1000,height=250,left = 12,top = 259');");
Then i move to output rewrite section add following code
<A HREF="javascript:popUp('[url]')">view</A>
But that url not open pop up window.is there any thing i missed.Any one point me my error.
thanks......
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
请在您的 js 文件中尝试此操作
如果不起作用, ,然后尝试将相同的代码放入 page.tpl.php 文件中。还可以尝试将回调表单 popUp() 的名称更改为其他名称。它可能与其他回调冲突。
Try this in your js file
if it doesn't work then try to put the same code in you page.tpl.php file. Also try with chang the name of your callback form popUp() to other name. It may be conflicting with other callback.