How to insert ads using JavaScript?


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...](

  * [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...](

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!](

  * [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 ...](

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...](

hope u understand what am asking thank you.

1 Like

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


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?


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


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.


not yet


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