简体   繁体   English

Drupal从完整HTML链接中删除JavaScript

[英]Drupal removing javascript from Full HTML link

I am new to Drupal and am trying to create a node (let's call it child) that will only really be accessed when clicked on from another node (we'll call it parent). 我是Drupal的新手,正在尝试创建一个节点(我们称其为子节点),只有在从另一个节点(我们将其称为父节点)上单击时才能真正访问该节点。 When closing the child window, I want to parent window to refresh. 关闭子窗口时,我想刷新父窗口。

Outside of Drupal, that's easy: 在Drupal之外,这很容易:

<a onclick="window.close(); window.opener.location.reload();" href="#">Click to close this window</a>

However, when I type this into the body of a node using Full HTML, it still strips the onclick text from my post. 但是,当我使用Full HTML将其键入节点的主体时,它仍会从我的帖子中剥离onclick文本。 How can I include javascript in the body of a node like this? 我如何在这样的节点主体中包含javascript? Is there a special module I need. 我需要一个特殊的模块吗?

Thanks! 谢谢!

You can customize input filters and make your own, to provide more options. 您可以自定义输入过滤器并自己制作,以提供更多选项。

Using the PHP input filter is not a good idea unless you really want to input PHP. 除非您真的想输入PHP,否则使用PHP输入过滤器不是一个好主意。
Also you might not want to give all admins that should make links with JavsScript access to writing PHP code on the site. 另外,您可能不希望所有应该与JavsScript建立链接的管理员都可以访问该站点上的PHP代码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM