Help: How to change html code

Subscribe to Help: How to change html code 21 posts, 9 voices

 
deki_bg User

Hi All,

Can you help me to make small script:

I want to find in html this code
100%,83
and to change it with
1,83

can you help me to do this?

 
deki_bg User

I try with this code

(function() {
document.evaluate("[@value='100%,83']", document.body, null, 8, null).singleNodeValue.value = "1,83";
})();

But it doens't work.

 
gollum Scriptwright

A bit more info needed...
Copy&Paste in the code containing the element you're trying to change

 
pranavs User

hey how did you make scrap to all funtion..can anybudy tell me..?plzz

 
Yansky Scriptwright

hey how did you make scrap to all funtion..can anybudy tell me..?plzz

Are the current 15 billion scrap all scripts not enough for you?

 
pranavs User

ya they ARE enauf but i wanted to kw how did you make it....
i m so confused....i tried it doing myself but i dint get it..can u help me out..i tried many things..hey to mak tat stuff do you need your own site?n if yes then wat after tat?

 
Yansky Scriptwright

but i wanted to kw how did you make it..

Ok, fair enough. The best resource for learning how to write greasemonkey scripts is Diveintogreasemonkey
Also look at DOM Reference and w3schools

Also the firebug extension for firefox will be of great use to you: http://www.getfirebug.com/

 
pranavs User

thxx a lot buddy....if i have futher problems i shall ask you..thxx again....hope that site will help me out......

 
deki_bg User

Here is my code:


<*FRAMESET rows="100%,83" FRAMESPACING="2" BORDER="4">

I want to change it to

<*FRAMESET rows="1,83" FRAMESPACING="2" BORDER="4">

Can you help me please.

 
deki_bg User

I found one script here and change it but it dones't work


var domainname = '100%,83';
var ipaddress = '1,83';
var allImgs, thisImg;
allImgs = document.evaluate(
'//*',
document,
null,
XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,
null);
for (var i = 0; i < allImgs.snapshotLength; i++) {
thisImg = allImgs.snapshotItem(i);
if (thisImg.src.match(domainname)) {
thisImg.src = thisImg.src.replace(domainname, ipaddress);
}
}

Tell me what it wrong here?

 
Descriptor Scriptwright

Man, you don't have a frigg'n clue.

 
deki_bg User

Descriptor, can you help me with this code please.
I'm not familiar with java.

 
wushi777 Scriptwright

Need the url address.

 
gollum Scriptwright

My temptation is to ignore this post as a troll, but to give you the benefit of the doubt ... you really need to read-up on html frameset.

 
Mikado Scriptwright

document.body.cols = '1,83'; // or whatever, since '1,83' won't make sense.

May look weird but frameset element is really document.body.

PS. deki's script is damn smart and creative for guy who knows nothing about javascript. My regards. Too bad he did't figure the last part to make it work.

 
psyched Scriptwright

Agreed!

 
LouCypher Scriptwright

If only he posted this in the right forum.

 
deki_bg User

But where to add this line?


document.body.cols = '1,83';

 
LouCypher Scriptwright

In your script
?

 
deki_bg User

To add it in this code:


var domainname = '100%,83';
var ipaddress = '1,83';
var allImgs, thisImg;
allImgs = document.evaluate(
'//*',
document,
null,
XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,
null);
for (var i = 0; i < allImgs.snapshotLength; i++) {
thisImg = allImgs.snapshotItem(i);
if (thisImg.src.match(domainname)) {
thisImg.src = thisImg.src.replace(domainname, ipaddress);
}
}

???

 
Mikado Scriptwright

No, just replace the whole code with that line.