Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #16020
| From | Dr J R Stockton <reply1237@merlyn.demon.co.uk.invalid> |
|---|---|
| Newsgroups | comp.lang.javascript |
| Subject | Re: Searching local pages for visible text |
| Date | 2012-09-19 20:06 +0100 |
| Organization | Home |
| Message-ID | <ayRJl+GlehWQFwaN@invalid.uk.co.demon.merlyn.invalid> (permalink) |
| References | <LKKNb4LHe6VQFwz7@invalid.uk.co.demon.merlyn.invalid> <2b9f3ead-7e38-429e-ba00-bd90794f43d4@o8g2000yqm.googlegroups.com> |
In comp.lang.javascript message <2b9f3ead-7e38-429e-ba00-bd90794f43d4@o8
g2000yqm.googlegroups.com>, Mon, 17 Sep 2012 21:01:41, David Mark
<dmark.cinsoft@gmail.com> posted:
>On Sep 17, 6:44 pm, Dr J R Stockton
><reply1...@merlyn.demon.co.uk.invalid> wrote:
>> I can search the source files of my site in various ways, and for
>> example that finds 61 copies of the string "center". That should occur
>> in HTML, in CSS, and in the display of a page section on spelling, only.
>
>Can you rephrase that?
Yes, but I write only for those who can read English, the language still
spoken in England. Dutch and Danes, in particular, are very good at it.
See /via/ <http://www.merlyn.demon.co.uk/quotings.htm#FredHoyle>.
>> One way is my LINXCHEK.HTM, which spiders the local master copy of the
>> site, and so only sees what is actually in my site, and ignores other
>> files. The search itself uses
>>
>> function ReadText(DOC) { var Cnt, Txt
>> Txt = DOC.body.textContent || DOC.body.innerText // latter for IE8
>
>Txt = DOC.body.textContent || DOC.body.innerText || '' // latter for
>IE8-
Well, that's an improvement; but not a very useful one. It reminds me
of a DOS clone which had an error in comment - but not in code -
concerning the behaviour in the year AD 2400. The code was written
after I replaced IE7. Implemented, tested, for public release later
this evening.
>> if (Txt) { if (WebPage.Name == "$.htm") alert(66)
>> if (HasShib) { Cnt = (Txt.match(ShibRE) || "").length
>> Form.TA2.value += SpcsTo(Cnt, 4) + " shibboleths\n"
>> WebPage.Shibs = Cnt } } }
>>
>> where DOC refers to the content of an iframe.
H'mmm - I wonder what that alert was for ... especially as it does not
get called when $.htm is used, and that's the only case-independent
"$.htm" in the file, and the local $.htm is really $.HTM.
>I really hate your style, doc. :(
>
>>
>> That searches the source text of the pages.
>
>If you say so.
Proven to my continued satisfaction by test.
>> What I want now is to search the text which the browser displays in the
>> iframe into which the spidered pages are read. There are too many pages
>> for it to be easy to display them in a browser and use its ordinary
>> Ctrl-F search.
>
>I sort of understood that.
>
>>
>> Above, "center" is just an example; I actually want to search for "left"
>> and "right", of which there are many more, to consider whether I'm
>> describing parts of my pages in a way that is inappropriate for blind
>> readers.
>
>Okay.
>
>>
>> There is no need to consider words which JavaScript has computed for
>> display, or whether a word is currently in a hidden element, etc.
>
>JS computed for display? Do you mean CSS?
No; CSS!=JS. I mean words such as appear because of the likes of
document.write(new Date())
or
document.getElementById("DM").innerText =
new Date().getMonth()-1 ? "Feb" : "notFeb"
>> Any suggestions?
>>
>
>Not at this time (would just be guesswork at this point).
Well, here's an approximately legal Web page :
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<HTML>
<HEAD><TITLE>JRS</TITLE></HEAD>
<BODY><center>centre</center></BODY>
</HTML>
With that loaded into <iframe ID=Z></iframe>, I have code which will see
one "centre" and two "center". I want alternative code which will see
one "centre" and zero "center".
--
(c) John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v6.05 MIME.
Web <http://www.merlyn.demon.co.uk/> - FAQish topics, acronyms, & links.
Proper <= 4-line sig. separator as above, a line exactly "-- " (SonOfRFC1036)
Do not Mail News to me. Before a reply, quote with ">" or "> " (SonOfRFC1036)
Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Searching local pages for visible text Dr J R Stockton <reply1237@merlyn.demon.co.uk.invalid> - 2012-09-17 23:43 +0100
Re: Searching local pages for visible text David Mark <dmark.cinsoft@gmail.com> - 2012-09-17 21:01 -0700
Re: Searching local pages for visible text Dr J R Stockton <reply1237@merlyn.demon.co.uk.invalid> - 2012-09-19 20:06 +0100
Re: Searching local pages for visible text David Mark <dmark.cinsoft@gmail.com> - 2012-09-19 17:09 -0700
Re: Searching local pages for visible text Dr J R Stockton <reply1237@merlyn.demon.co.uk.invalid> - 2012-09-21 21:35 +0100
Re: Searching local pages for visible text David Mark <dmark.cinsoft@gmail.com> - 2012-09-21 16:33 -0700
Re: Searching local pages for visible text Dr J R Stockton <reply1237@merlyn.demon.co.uk.invalid> - 2012-09-23 19:49 +0100
csiph-web