How to insert ads using JavaScript?

#1

i want to know if i can get this to happen.

let say i post a content i want to use javascript to insert a NOTE TAG OR ADVERT for every for 300 words or every 4 sentence

for example

### ur topic is similar to...

  * [# of uploads, need some assistPHPNov '11 - I have this feature setup for loading a number of songs, however I would like to change the code so it only allows user to upload 4 songs then, see, you have reached the limit. How Would you sugges...](http://www.sitepoint.com/community/t/of-uploads-need-some-assist/94798)

  * [Need 301 redirect assistServer ConfigJan '14 - This redirect will be used on our host, WPEngine, using their redirect tool; in other words, I will not be placing this into an htaccess file. So, this needs to be a 301 redirect -- not a mod rewri...](http://www.sitepoint.com/community/t/need-301-redirect-assist/39021)

advert appears

  * [I need Some Quick PHP AssistancePHPMay '10 - Hello, My current code is - if ($similar['prodPrice'] == 0.00) { I am looking to list out 0.00 1.00 2.00 etc up to 5.00. Could someone share how I would need to write it out? Thanks in advance!](http://www.sitepoint.com/community/t/i-need-some-quick-php-assistance/58377)

  * [If , Else If need assistance pleasePHPDec '18 - Hi guys Trying to display stars with the below code, my If and elseif is causing me endless frustration. it needs to display the number of stars that the $starNumber variable is. if i do it one by ...](http://www.sitepoint.com/community/t/if-else-if-need-assistance-please/314703)

advert appears

  * [Ok, I Am Fried - Need CSS Assistance From A ProHTML & CSSAug '10 - To anyone that can assist, thank you (for real). I am fried from trying to read, review, test, and search for a solution. And in the end, I know it will be that I overlooked something, so let me sa...](http://www.sitepoint.com/community/t/ok-i-am-fried-need-css-assistance-from-a-pro/65792)

hope u understand what am asking thank you.

1 Like
#2

Sounds like you’re trying to spam your own website :upside_down_face:

#3

actually its for blog section of my website am d only allowed to blog so i definately will know how to regulate it.

but u understand what am trying to explain right?

#4

actually this is what i need too… so still no answer skyhigh?

#5

I tried coming up with a regex to do it, but kept blowing up my browser.
I recommend that others try using loops instead if they want to explore options.

#6

not yet

#7

how to go about it, i dont even know wat to search for a name for it