Hi,
How can I attach a JS file to the iframe of the editor so that I can include javascript calls in my content?
For example, I have a simple "show/hide div" javascript function in a file called scripts.js. I have content, managed via the editor, that contains the following HTML:
<a href="#" onclick="toggle_visibility('foo');">CLICK HERE</a>
<div id="foo" style="DISPLAY: none">MY CONTENT</div>
This code simply shows or hides the div named "foo".
The problem is that when editing the HTML in the editor, the page quickly displays a javascript error, breaking the editor. My best guess is that the iframe used by the editor cannot see the linked JS file. So it seems that attaching the JS file to the editor or iframe somehow would solve this.
Make sense?
Thanks for any help,
Joe
How can I attach a JS file to the iframe of the editor so that I can include javascript calls in my content?
For example, I have a simple "show/hide div" javascript function in a file called scripts.js. I have content, managed via the editor, that contains the following HTML:
<a href="#" onclick="toggle_visibility('foo');">CLICK HERE</a>
<div id="foo" style="DISPLAY: none">MY CONTENT</div>
This code simply shows or hides the div named "foo".
The problem is that when editing the HTML in the editor, the page quickly displays a javascript error, breaking the editor. My best guess is that the iframe used by the editor cannot see the linked JS file. So it seems that attaching the JS file to the editor or iframe somehow would solve this.
Make sense?
Thanks for any help,
Joe