Useful Links

Extract an article's body without the rest of the code that Joomla! generates with AJAX call Print E-mail
(0 votes, average 0 out of 5)
Wednesday, 24 March 2010 10:18

After following the instructions on how to extract an article's body, you should have a URL that shows only the content of your article.

Use the Mootools code below to update the contents of an HTML element with your article:

  1. window.addEvent('domready', function(){
  2. article = 'index.php?option=com_content&view=article&id=1&tmpl=component';
  3. var a = new Ajax( article, {
  4. method: 'get',
  5. update: $('id_of_element')
  6. }).request();
  7. }

Notes

  • Place the Javascript code using the heredoc syntax to include it in Joomla! you can find more info this at the Joomla! documentation site
  • Be sure to use the exact syntax when referring to the ID of an element and not use the pound sign (#).
    i.e. don't use $('#id_of_element'), $(#id_of_element) or $$('id_of_element').
    Valid syntax is $('id_of_element') and $$('#id_of_element'). I prefer the first option. The second syntax (with two dollar signs) may refer to multiple IDs and/or HTML tags, while the first one is limited to only one element ID (not HTML tags).

Comments (0)
Write comment
Your Contact Details:
Comment:
[b] [i] [u] [url] [quote] [code] [img]   
:D:angry::angry-red::evil::idea::love::x:no-comments::ooo::pirate::?::(
:sleep::););)):0
Security
Please input the anti-spam code that you can read in the image.
 

Limassol Weather

Now
Fair
13°C, Windchill: 13°C
Wind: 24 kph NE
Humidity: 54%
Visibility: 0 km
pressure: 1,018 mb falling
Sunrise: 6:41 am
Sunset: 5:21 pm
Mon
Partly Cloudy
Hi: 17°C, Low: 11°C
Tue
AM Rain
Hi: 17°C, Low: 10°C
Joomla Templates by Joomlashack