Page 2 of 2

Re: How to use javascript in articles?

Posted: Sat Feb 20, 2010 12:31 am
by click2grow
mssmtih13 wrote:Hey click2grow...can you post the javascript code your using (of course removing any identifiable information from it first)
<script type="text/javascript" src="swfobject.js"></script>
<div id="index">
Upgrade your Flash Player to version 8 to view this video! (<a href=http://fpdownload.macromedia.com/get/fl ... player.exe target=_blank>Click here for the download</a>)
</div>
<script type="text/javascript">
var so = new SWFObject("RolloverPlayer.swf?path=http://www.Click2Grow.com/media/video/M ... &redirect=", "index", "420", "340", "8", "#ffffff");
so.write("index");</script>


followed by

<script type="text/javascript" src="swfobject.js"></script>
<div id="index">
Upgrade your Flash Player to version 8 to view this video! (<a href=http://fpdownload.macromedia.com/get/fl ... player.exe target=_blank>Click here for the download</a>)
</div>
<script type="text/javascript">
var so = new SWFObject("RolloverPlayer.swf?path=http://www.Click2Grow.com/media/video/b ... &redirect=", "index", "420", "340", "8", "#ffffff");
so.write("index");</script>

Re: How to use javascript in articles?

Posted: Sat Feb 20, 2010 9:43 pm
by click2grow
mssmtih13 wrote:
click2grow wrote:I'm trying to add 2 flash videos to a page via java script. When I put 1 on the page it works just fine. When I put both on the page only the first one alphabetically plays regardless of which one is first on the page. I get the same result inserting through JCE and Sourcer.

Here is the page: http://www.click2grow.com/video-marketing.html

/media/video/MassageByJJ.FLV is the first one on the page, but when I put both java script codes in the same article only this one Plays:

/media/video/bellwether.FLV

Right now both JS code has been inserted using sourcer and I get the same problem. I contacted my hosting company and they said I'm missing a plugin for joomla to make them both run. That's when I tried sourcer and I'm still stuck.
Hey click2grow...can you post the javascript code your using (of course removing any identifiable information from it first)
click2grow wrote:<script type="text/javascript" src="swfobject.js"></script>
<div id="index">
Upgrade your Flash Player to version 8 to view this video! (<a href=http://fpdownload.macromedia.com/get/fl ... player.exe target=_blank>Click here for the download</a>)
</div>
<script type="text/javascript">
var so = new SWFObject("RolloverPlayer.swf?path=http://www.Click2Grow.com/media/video/M ... &redirect=", "index", "420", "340", "8", "#ffffff");
so.write("index");</script>


followed by

<script type="text/javascript" src="swfobject.js"></script>
<div id="index">
Upgrade your Flash Player to version 8 to view this video! (<a href=http://fpdownload.macromedia.com/get/fl ... player.exe target=_blank>Click here for the download</a>)
</div>
<script type="text/javascript">
var so = new SWFObject("RolloverPlayer.swf?path=http://www.Click2Grow.com/media/video/b ... &redirect=", "index", "420", "340", "8", "#ffffff");
so.write("index");</script>
Someone else I spoke with suggested designating var so1 and var so 2 with so1.write and so2.write, but that didn't work either. I decided just to make a playlist instead of having two scripts and that works fine.

Re: How to use javascript in articles?

Posted: Thu Jan 06, 2011 10:49 pm
by agilitycns
This thread was a huge help in getting Google Multivariant Testing to work in Joomla 1.5. Adding 'Allow Javascript' was the final key. This allowed javascript (kind of hidden in the groups section of the JCE editor control panel) into the articles to accept the Google code needed for Multivariant testing. I also have phpInclude up and running so I'm not sure if this helped also. Thank you!
C.

Re: How to use javascript in articles?

Posted: Tue Apr 19, 2011 1:53 am
by fcelio
K so where is the enable java script button. Ive been reading this yet when i get intpo joomla i do not see it as described.

Re: How to use javascript in articles?

Posted: Sat Apr 30, 2011 1:35 pm
by mido203
always18 wrote:Hi guys,

I have better solution for this problem. No need to choose No WYSIWYG editor in global configuration of site. You can also write javascript in articles using default editor(TinyMCE 2.0).

Steps ->

Go to plugin manager & click on TinyMCE 2.0
Go to plugin parameters
select " never " to Code cleanup on save option & save it.
Now you can write your javascript in articles(joomla).

I hope it ll be useful for you all.

Regards,
Always18
It works !
Thank you very much

Re: How to use javascript in articles?

Posted: Sat Apr 30, 2011 8:58 pm
by fcelio
Unfortunately this is not working for me. I get a blank page for the article with only the article heading???????

Re: How to use javascript in articles?

Posted: Fri Jul 15, 2011 3:09 pm
by brutalicious
i was having problems here but turned off jce pasted the code then turned jce back on worked however the images i wanted to display weren't perfect (http://milesandbarrcashforcharity.co.uk/argos.html) the argos search box on the top left should have the blue border all around the searchbox :(

Re: How to use javascript in articles?

Posted: Tue Jul 19, 2011 7:58 pm
by marfic
Guys, your posts are very helpful. Thanks for keeping us up to date.



Marfic Technologies
www.marfic.com
Milpitas, CA

Re: How to use javascript in articles?

Posted: Fri Feb 03, 2012 5:11 am
by dchktester
always18 wrote:Hi guys,

I have better solution for this problem. No need to choose No WYSIWYG editor in global configuration of site. You can also write javascript in articles using default editor(TinyMCE 2.0).

Steps ->

Go to plugin manager & click on TinyMCE 2.0
Go to plugin parameters
select " never " to Code cleanup on save option & save it.
Now you can write your javascript in articles(joomla).

I hope it ll be useful for you all.

Regards,
Always18
It doesn't work for me :'(

Re: How to use javascript in articles?

Posted: Fri Mar 02, 2012 3:59 pm
by coolgrafix
Guys, the definite guide to enabling JavaScript insertion with JCE is provided at the JCE site here:

http://www.joomlacontenteditor.net/supp ... -on-saving

Covers Joomla 1.5, 1.7, and 2.5.

Spent a goodly amount of time on this issue myself until I found this nugget.

For Joomla 2.5, it was two simple steps... the settings in the JCE configuration (which is, yes, buried), and also Joomla 2.5's text filter settings.

--Brad =)

Re: How to use javascript in articles?

Posted: Mon Jan 28, 2013 2:22 pm
by tophatmoney
Hi, I got it working too thanks to this thread.

It was similar to the simple 'turn code cleanup off' option but not the same so in case anyone else is struggling this is what worked for me.

1. Extensions > Plug in Manager
2. Editor - TinyMCE
3. Basic functionality > Prohibited Elements
4. Listed as 'Prohibited Elements' => "script, applet, iframe"
5. I simply removed 'script' from this list and I can type / copy&paste js script directly into the article editor and it is not stripped out on save.

Thanks for the help.
T

Re: How to use javascript in articles?

Posted: Sun Feb 03, 2013 5:28 pm
by chattwo
Hi,
I run joomla 1.5.26
editor >> no editor enabled