Can't insert javascript
I want to insert the following javascript into a page:
function showProducts() {
document.getElementById('menu42__1271').style.display='block';
setTimeout("getElementById('menu42__1273').style.display='block'",1000);
}
I've installed the javacript plugin, js.
I've tried doing what the documentation says and surrounding the code with these tags:
(open curly bracket)JS()(close curly bracket)
//code here
(open curly bracket)JS(close curly bracket)
(I can't seem to embed these tags in a reply on this forum, hence the curly bracket things above)
This produces the following error when I save the page:
An error occured in a database query!
Context:
File tiki-index.php
Url tiki-index.php?page=HomePage
Query:
INSERT INTO tiki_plugin_security (fingerprint, status, added_by, last_objectType, last_objectId) VALUES(?, ?, ?, ?, ?)
Values:
0 js-28cb81ce60a35eb62e7d94537f8d1aa5-0df3f8fa6a273b5283894cce2d1e8455-180000-200000
1 pending
2 admin
3 wiki page
4 HomePage
Message:
Built query was probably:
INSERT INTO tiki_plugin_security (fingerprint, status, added_by, last_objectType, last_objectId) VALUES('js-28cb81ce60a35eb62e7d94537f8d1aa5-0df3f8fa6a273b5283894cce2d1e8455-180000-200000', 'pending', 'admin', 'wiki page', 'HomePage')
I've tried taking out all the code and just inserting those {JS} tags but the error still persists, so I know it's not an error in my javascript.
I've tried searching the forum and found another syntax for surrounding the code:
(script type="text/javascript")
//code here
(/script)
That just results in the javascript code being rendered in full view on the page.
Any help would be appreciated.