5099 Posts in 1519 Topics by 1116 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1761 Views |
-
Adding external JavaScript

1 April 2009 at 9:23am
jsMath javascript suite is very useful for displaying math
On normal pages produced with this script in mind it is enough to add <script type="text/javascript" src="jsMath/jsMath.js">
How one can load some js on SilverStripe pages?Thank you in advance. Victor
-
Re: Adding external JavaScript

3 April 2009 at 2:11pm
So, what is the way to add external javascript to CustomPage?
Thank you in advance
Victor
-
Re: Adding external JavaScript

10 April 2009 at 4:16pm
how about
Requirements::javascript("filejs");
-
Re: Adding external JavaScript

11 April 2009 at 7:46am
Well, I know this (and it should be enclosed into
public function init()
{}
However it does not work in some particular case:
Compare
http://weyl.math.toronto.edu:8888/devsite/x.html
which shows properly parsed mathematical expression
with
-
Re: Adding external JavaScript

11 April 2009 at 10:39pm
Hi Victor
On the page where it works you have the following javascript statement: jsMath.Process();
Whereas on the SilverStripe site it's completely lacking...
You should probably addRequirements::customScript('jsMath.Process();');
to your init method.
Some other file seems to be missing on the SilverStripe site as well. I get the following error in firebug:
uncaught exception: jsMath can't load the file 'http://weyl.math.toronto.edu:8888/devsite/test/jsMath-fallback-symbols.js' Error status: 404 -
Re: Adding external JavaScript

12 April 2009 at 12:23am
Well, it did not work this way but your post suggested me a different solution: instead of paste htm source in (html) in Content allowing to TinyMCE to handicap it, I created new HTMLText field and pasted html snippet with reference to javascript there
http://weyl.math.toronto.edu:8888/devsite/test/?stage=Live
PS Still I left reference to jsMath in .php, I suspect it is needed
Thanks! Victor
-
Re: Adding external JavaScript

9 January 2013 at 1:18pm
how about
LeftAndMain::require_javascript('mysite/javascript/initGoogleMaps.js')
| 1761 Views | ||
|
Page:
1
|
Go to Top |



