javascript 无法接受视图中的输出重写

发布于 2024-12-11 18:37:26 字数 591 浏览 0 评论 0原文

我需要显示节点标题、节点编辑和节点 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技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

挥剑断情 2024-12-18 18:37:26

请在您的 js 文件中尝试此操作

function popUp(URL) {
     var  day = new Date();
     var  id = day.getTime();
     window.open(URL);
}

如果不起作用, ,然后尝试将相同的代码放入 page.tpl.php 文件中。还可以尝试将回调表单 popUp() 的名称更改为其他名称。它可能与其他回调冲突。

Try this in your js file

function popUp(URL) {
     var  day = new Date();
     var  id = day.getTime();
     window.open(URL);
}

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文