|
Once you have a Joomla site running, sooner or later you may want to use javascript, and if you are a more advanced user that's likely to mean jQuery too.
This tutorial is about using javascript of jQuery with Joomla, showing exactly what you need and how to set it up so that it works.
Overview of using javascript with Joomla
Joomla stores the articles that will be published on your website in a database. When Joomla stores the pages it expects text and images, not javascript or html. If you try to put javascript directly onto the page like this . . .

what you you will see on the web page is . . .

So it's obvious that is not going to work. The javascript is being interpreted as plain text instead of being executed by the browser. What we need is a way to insert the javascript directly into the page.
One way to work around this is to use a plain text editor in Joomla, or to click the [show/hide] link above the editor icons, which toggles the visual editor off and shows the actual code . . .

this does work around the difficulty, and so the browser does execute the javascript, in this case showing an alert.

That's one way, but it's not very convenient.
|