Script that gives the amount of a given term of a page (javascript)

Asked

Viewed 26 times

-1

For example, I would like to know how many times the term "] = new entry (" appears on the page.

the_entries[228]    =   new entry ( "http://www.respondi.com.br/2017/03/como-o-cristao-deve-se-posicionar.html","Como o cristão deve se posicionar politicamente?","tags","</br> <a href='https://www.youtube.com/embed/F-rdTFbX-yk?autoplay=1%20' target='_blank'><img style='cursor:pointer;width:50px;height:40px;'  src='logos/youtube-2-1.svg'/></a>");


the_entries[229]    =   new entry ( "http://leituracrista.com/o-que-respondi-volume-01/#como-os-dons-se-manifestam-na-igreja","Como os dons se manifestam na igreja?","tags","</br> <a href='https://www.youtube.com/embed/GNfiv2RrqTI?autoplay=1%20' target='_blank'><img style='cursor:pointer;width:50px;height:40px;'  src='logos/youtube-2-1.svg'/></a>");
  • What page? Where does this content come from? What is the_entries and entry?

  • @Andersoncarloswoss, it’s a search page, in javascript, but whenever I get a new line, like the one I put up, I have to change the number of lines in the script, so I’d like it to be done dynamically, that is every time I add a line the quantitative was updated automatically: this is the page, at the end is the quantity part: http://leituracrista.com/indice Thanks for asking!

  • Don’t just take the number of elements from the array with the_entries.length?

  • Yes it can be, how can I do it? I even think that this is the correct question. rsrs

  • Solved @Andersoncarloswoss, thank you very much

1 answer

0


Adding the following row to pick up the total of entries:

entradas = the_entries.length
alert(entradas);

Browser other questions tagged

You are not signed in. Login or sign up in order to post.