3214 Posts in 848 Topics by 810 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1085 Views |
-
Variables inside inline Javascript ?

9 June 2010 at 12:08am
Is it possible to put Variables inside inline Javascript:
Where $SlideShowSpeed will become a number from the CMS, currently it outputs nothing...
MyPage.ss
...
<script type="text/javascript">//<![CDATA[
...
//Call the rotator function to run the slideshow, 6000 = change to next image after 6 seconds
setInterval('rotate()', {$SlideShowSpeed}000);
}
...
//]]></script>
... -
Re: Variables inside inline Javascript ?

9 June 2010 at 7:44am
yes this is posible.
create a method in the controller with the name SlideShowSpeed which returns the value.
-
Re: Variables inside inline Javascript ?

9 June 2010 at 7:50am
Sorry I wasn't very clear, I have already created the method the problem was it was returning nothing, but after your suggestion I found I was calling the wrong one in the template!! apologies thanks though
| 1085 Views | ||
|
Page:
1
|
Go to Top |


