Search words on page and replace

Asked

Viewed 61 times

1

Friends, I wonder if it is possible to create a method that scans an html page or only inside a div, looking for a specific word and replace it with another word.

I’m trying to do this because I’m using a plugin on my site, and the same does advertisements, I don’t want to veto advertisements, I just want to have a control of the words that this plugin will use in the advertisements it does. Is it possible? Thanks in advance!

Plugin:

<script type='text/javascript'>
(function(){ var widget_id = 'qZZLGGRS0H';var d=document;var w=window;function l(){
var s = document.createElement('script'); s.type = 'text/javascript'; s.async = true; s.src = '//code.jivosite.com/script/widget/'+widget_id; var ss = document.getElementsByTagName('script')[0]; ss.parentNode.insertBefore(s, ss);}if(d.readyState=='complete'){l();}else{if(w.attachEvent){w.attachEvent('onload',l);}else{w.addEventListener('load',l,false);}}})();</script>
  • You have two questions in one: 1- it is possible to scan a page and replace content: yes, 2- it is possible to replace content inside plugins: probably not because if they are iframes there are browser security measures that prevent this.

  • That said :You can put an example plugin?

  • posted the plugin. ?

  • You can process the script on the server side and then integrate it into your page, but then it won’t activate the advertiser statistic...

No answers

Browser other questions tagged

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