![]() ![]() |
could someomne help me with my script becuase it's not working. |
![]() ![]() |
Your syntax is wrong. The script should be: (function() {
Array.forEach(document.images,function(image){if (image.src.indexOf("1x1_trans.gif")!=-1) image.parentNode.removeChild(image);})
})
();
The problem is you have too many brackets at the end of your script. |
![]() ![]() |
They made a new (function() {
for each(var image in document.images) if(image.src.indexOf("1x1_trans.gif")!=-1) image.parentNode.removeChild(image);
})();
But if I was you, I'd use XPath. (function() {
var array=document.evaluate("//img[contains(@src,'1x1_trans.gif')]",document,null,6,null);
for(var i=0,item; (item=array.snapshotItem(i)); i++) item.parentNode.removeChild(item);
})();
|
![]() ![]() |
thanks everyone for the help. |
![]() ![]() |
tried all of them but it doesn't work |
![]() ![]() |
For a site that requires a login, you need to save and post the html for the page you are trying to modify. Nobody is going to sign up for a website just to troubleshoot a script. |
![]() ![]() |
bumped |
![]() ![]() |
IRoll11!~s wrote: Or you can put the source code of the web page on http://pastie.org/ or http://pastebin.com/ |
![]() ![]() |
userscriptfa... wrote:I'm not signing up, please give a login. |
![]() ![]() |
Edit: Opps, this post is wrong ignore it. Saved for prosperity:
|
![]() ![]() |
kooks wrote:Actually no he is not. It works perfectly. kooks wrote:Wrong. for() does... for each() does not.
|
![]() ![]() |
I like python's for ... in so much
|


