![]() ![]() |
I now use this code to search for text in a table
But this code seems to not either stop the script or don't find the row in some cases.
The search string i use includes letters space and "-" ">" and dot (example "Text -> text. Text") is there some of these i have to escape to get it working or is there another way of searching?
Ty all for reading |
![]() ![]() |
the Web Developer extension's Error Console would help you debug: https://addons.mozilla.org/en-US/firefox/addon/...
Using the your first line looks wrong but I see it's just got mangled by posting it here. |
![]() ![]() |
Your loop didn't post correctly. The textContent should be the content of the cell stripped of tags. If you look at the source of the page, can you see anything peculiar about the missing matches? Please note that JavaScript is case sensitive. If you need a case insensitive search, you could do this: for (var i=0; i<rowset.length; i++){
if (rowset[i].cells[0].textContent.toUpperCase().indexOf("TEXT") > -1) rowset[i].style.backgroundColor = color01;
}
|
![]() ![]() |
[10:07:57.408] Expected ':' but found '.'. Declaration dropped. @ http://domain.org/webpub/cgstilmall.css:254 Could this be whats bugging my script. Looks like it works for now without any change. But could i replace . with something to get this script execute without errors? Or is this just an error from css? |
![]() ![]() |
"Declaration dropped" definitely refers to a CSS warning. |



