Anyone here is a real JS expert?

W

Wow

Or are you just looking to understand "innerHTML" can be used to change
content.

http://www.devguru.com/technologies/dhtml/quickref/property_innerhtml.html

Can I say this: The publisher must INCLUDE INNERHTML codes so the JS file
can replace them with ads?
I thought it was just a plain HTML code then the JS file replaces the
keywords... such as

This is a hosting company --> This is a <somecodes>hosting</somecodes>
company

Do you think google adsense is also using this technology to scan content
from client side rather than using Bot to scan the page.

From the link you provided, it says it can scan anything in between
<html></html>... Powerful stuffs. That is exactly what I am looking for my
current project. Great help. thanks.
 
W

Wow

Or are you just looking to understand "innerHTML" can be used to change
content.

http://www.devguru.com/technologies/dhtml/quickref/property_innerhtml.html

I made a tiny script to demostrate that:


keyword1:<P> hosting</P>
keyword1:<P> refinance</P>


<a href="#"
onMouseOver =

"searchkeyword(this.previousSibling.previousSibling.previousSibling.innerHTM
L)" >
move your mouse over here</a>


<a href="#"
onMouseOver =

"searchkeyword(this.previousSibling.previousSibling.previousSibling.innerHTM
L)" >
move your mouse over here</a>

<script>
function searchkeyword(keyword){
window.open("http://www.google.com/search?q="+keyword);
}
</script>
 
W

Wow

better written codes

<HTML>
<TITLE> THIS IS DHTML PRACTICE </TITLE>

<P ID=key1> hosting my ass</P>
<P ID=key2> refinance</P>


<a href="#"
onMouseOver = "searchkeyword(key1.innerHTML)" >
search the first line in google</a>


<a href="#"
onMouseOver =

"searchkeyword(this.previousSibling.previousSibling.previousSibling.innerHTM
L)" >
search the second line in google</a>


<a href="#"
onMouseOver = "key1.innerHTML=replace(key1.innerHTML,'ass','****' )" >
replace ass with ****</a>

<script>
function searchkeyword(keyword){
window.open("http://www.google.com/search?q="+keyword);
}


function replace(string,text,by) {
// Replaces text with by in string
var strLength = string.length, txtLength = text.length;
if ((strLength == 0) || (txtLength == 0)) return string;

var i = string.indexOf(text);
if ((!i) && (text != string.substring(0,txtLength))) return string;
if (i == -1) return string;

var newstr = string.substring(0,i) + by;

if (i+txtLength < strLength)
newstr += replace(string.substring(i+txtLength,strLength),text,by);

return newstr;
}

</script>
 
T

Thomas 'PointedEars' Lahn

Wow said:
Can I say this: The publisher must INCLUDE INNERHTML codes so the JS file
can replace them with ads?

You can say anything you want. Whether that makes sense or not
is a different matter. Why don't you just get yourself educated?
RTFFAQ! RTFM!


PointedEars, Score adjusted
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top