Insert module position using jQuery in joomla 3

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:

  1.    $(document).ready(function() {
  2. $( "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>" );
  3.    });

But instead of a simple image I'd like to insert a module position. I changed the code and it looks like this:

  1. $(document).ready(function() {
  2. $( "div.item-page p:nth-child(3)" ).append( '<jdoc:include type="modules" name="in_article" style="none" >' );
  3.    });


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?