简体   繁体   English

如何在Joomla模块BACKEND中加载Javascript调用?

[英]HOW do I load a Javascript call in a Joomla module BACKEND?

I'm developing a simple module fo Joomla 2.5. 我正在为Joomla 2.5开发一个简单的模块。 Everything is almost done, but I have a series of form fields in the module params backend, which I would like to hide when a specific checkbox is clicked on... I have the function made, it's just a loop with a document.getElementblablablabla.style.display = 'none', but how can I load the JS and attach the function to the checkbox? 一切都差不多完成了,但是我在模块params后端中有一系列的表单域,当单击一个特定的复选框时,我想隐藏这些表单域。我已经完成了这个函数,它只是一个带有文档的循环。getElementblablablablabla .style.display ='none',但是如何加载JS并将函数附加到复选框?

A Quick solution! 快速解决方案!

you can include all your script inside your module XML files as normal script. 您可以将所有脚本作为普通脚本包含在模块XML文件中。 for this method you can use the description tag of XML file like this 对于这种方法,您可以像这样使用XML文件的描述标签

<description>
<![CDATA[
<script type="text/javascript">

//Your javascript code(s)

</script>
]]>
</description>

This method work fine for Joomla version but its not a professional method. 此方法在Joomla版本上工作正常,但不是专业方法。 If you prefer more standard way you have to use param from php file or here 如果您更喜欢标准方式,则必须使用php文件中的 param或此处

Hope its helps.. 希望能有所帮助

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

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