, Guest!
Already a Member? Login or Register.

Menu



Showcase


Due to the volume of spam happening on our forums, posting is now restricted to verified members only.  If you're not verified, drop us a note with your username.

Home > FlexCMS Support Forum > User Help > General Support Requests > Executing JavaScript in menu block

FlexCMS Support Forum


Executing JavaScript in menu block
Started April 5, 2006 @ 7:55pm by rvdc2005
Post Message 
rvdc2005


Posts: 17
 
Executing JavaScript in menu blockApril 5, 2006 @ 7:55pm
How do I execute JavaScript in a menu block? I have a menu block in which I want to display a "fact of the day," which is controlled by JavaScript.

Thanks
Ron
 
DCSun
Administrator



Posts: 625
 
April 5, 2006 @ 9:55pm
Hi Ron,

Simply paste the JavaScript into the block contents and you should be all set. You don't need to enable anything, or change anything in the JavaScript itself. Pretty much anything you could do in a standard HTML page you can do in a FlexCMS block or page.


David


FlexCMS v3.2 Has Been Released!
 
rvdc2005


Posts: 17
 
April 6, 2006 @ 10:21am
Thanks for your reply. I had done what you suggested, but that didn't work. I must have done something wrong. I'll try again. Is there a way to reference FlexCMS's base directory in the JavaScript, so I can write something like "src=[FlexCMS_URL]/js/myscript.js"?

Thanks
Ron
 
DCSun
Administrator



Posts: 625
 
April 6, 2006 @ 5:08pm
Hi Ron,

You're on the right track, but you'll have to add PHP into the mix to get JavaScript the path of the FlexCMS site.

You can do that by enabling PHP in the block or page, and using code something to the effect of this:

Code

print '<script src="'.$BaseURL.'/js/myscript.js"></script>';



David


FlexCMS v3.2 Has Been Released!
 

Last Edit: April 6, 2006 @ 5:08pm by DCSun
rvdc2005


Posts: 17
 
April 6, 2006 @ 6:37pm

Quote (DCSun)

You can do that by enabling PHP in the block or page, and using code something to the effect of this:

Code

print '<script src="'.$BaseURL.'/js/myscript.js"></script>';


Works perfectly. Thanks!

Ron


David
 

Post Message 




Try & Buy FeedForAll - Easy to use RSS Feed Creator - great for iTunes users!

MEMBERS




All Contents, Code, Scripts and Technologies Copyright 2003-2009 FlexCMS.
All Rights Reserved. Software License Agreement

Processing Time: 0.07652 seconds.
 
Management Login

Powered By FlexCMS
Powered By FlexCMS