Insert module position using jQuery in joomla 3
I'd like to put an advertisement into every article (after the third paragrapth).
The code below works well and a banner is visible after every third paragraph of every article:
- $(document).ready(function() {
- $( "div.item-page p:nth-child(3)" ).append( "<p style='text-align:center;'><a href='#'><img src='http://mydomain.com/images/banners/miejsce_na_twoja_reklame_w_artykule.gif' /></a></p>" );
- });
But instead of a simple image I'd like to insert a module position. I changed the code and it looks like this:
- $(document).ready(function() {
- $( "div.item-page p:nth-child(3)" ).append( '<jdoc:include type="modules" name="in_article" style="none" >' );
- });
The html output of the module is visible in head section, inside the script and it shows nothing in articles. Any idea how to change that?