1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

How to add javascript code in joomla CMS website?

Discussion in 'Joomla' started by universe, May 1, 2007.

  1. #1
    How to add javascript code in joomla CMS website?
     
    universe, May 1, 2007 IP
  2. maroon_cool

    maroon_cool Active Member

    Messages:
    850
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    75
    #2
    In joomla Administrator area go to : Site>GlobalConfig. Here for : Default WYSIWYG Editor choose No WYSIWYG editor,then click on the save button.Now you can place your javascript ;)
     
    maroon_cool, May 1, 2007 IP
  3. virtuoso

    virtuoso Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    install Sourcerer! plugins in your site visit my tutorial here:
    http://www.virtuosomaster.com/tutorials/adding-javascript-php-css-in-joomla-15-content-is-made-easy/
     
    virtuoso, Oct 19, 2008 IP
  4. always18

    always18 Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Hi guys,

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

    Steps ->

    Go to plugin manager & click on tiny 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
     
    Last edited: Aug 20, 2009
    always18, Aug 20, 2009 IP
  5. salcoWeb

    salcoWeb Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Hi

    I tried the above suggestion with but it doesn't work, my java script is still stripped out.

    Attached is a screen grab of the code I need to insert. It's a widget that will allow a companies freeindex.com customer reviews to automatically appear on their website.
     

    Attached Files:

    • code.jpg
      code.jpg
      File size:
      20.2 KB
      Views:
      21,241
    salcoWeb, Oct 14, 2010 IP
  6. always18

    always18 Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Hi SalcoWeb,

    Strange!! i am not getting why it is not working. But i have another options which are better than the above solution. You can install JCE editor. JCE editor is more efficient than TinyMce editor. In TinyMce editor, it adds extra tags like mce_href & it changed the code according to it's structure.

    You try JCE editor, i hope it may solve your problem.

    http://www.joomlacontenteditor.net/downloads/editor/item/jce-installation-package?category_id=14
     
    always18, Oct 14, 2010 IP
  7. Jrhodes

    Jrhodes Peon

    Messages:
    24
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    The sourcerer plugin is good. Also you might want to try this way. Using Filezilla or other FTP Client go to joomla installation file, then go to templates, and then find index.php or index.html and add javascript there. Hope this helps.
     
    Jrhodes, Oct 18, 2010 IP
  8. Cybernac

    Cybernac Peon

    Messages:
    27
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Thanks for this information. I had been looking for it a long time. Curiously though, it worked great in my Joomla 1.0 sites but when I tried it in 1.0 Legacy - it stripped out all my images! Still...a great help to me since most of my sites are still Joomla 1.0 and although I've had them for 2 years now, I still struggle with it!
     
    Cybernac, Dec 6, 2010 IP
  9. Mister_RAT

    Mister_RAT Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    hi guys..
    I have an any code module and a java script code inside it (its about change picture by mouse over)this module is working on all page of site.and it's work well in my first page.
    but in other pages when I move my mouse on each pic that picture is disappear and show just link of that...
    is there any good Ida,or a solution for it...
    help pls....:confused:
     
    Mister_RAT, Dec 19, 2011 IP
  10. lamvt

    lamvt Active Member

    Messages:
    153
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    58
    #10
    Your problem is Joomla javascript conflic, easy to fix it google with key: mootool joomla conflic
    Happy Christmas
     
    lamvt, Dec 20, 2011 IP
  11. Ryan Jin

    Ryan Jin Peon

    Messages:
    117
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #11
    Ryan Jin, Jan 15, 2012 IP
  12. Abscooters

    Abscooters Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #12
    Some of those ways work, there are add-ons for embedding them in different tags, but none of them are cut and dry.

    The latest version of sourcerer only works with the very latest hosting enviroments, doesn't work on my godaddy hosting account.

    Easiest way if you are not doing this to alot of articles (and they don't get edited on a regular basis)is:
    • Write the article and proof read it making note of where you want to add the script.
    • Go into your database in mysql or other database editor
    • browse the jos_content table
    • edit the record that is your article and scroll to where you want the script in the introtext field and insert your script.
    • hit save or go


    Make note: If you go back in through the joomla article editor, it is going to restrip out the scripts and you will have to do it again.
     
    Abscooters, Oct 19, 2012 IP