473,385 Members | 1,384 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

How to grab specific string of text from HTML page to display in pop up browser window?

Ed
I am building a glossary. Each letter of the alphabet has its own
HTML page, and each glossary entry on the page already has a unique
HTML anchor tag immediately to the left of it.

I've already learned how to do a Javascript pop up browser window. Is
there a way to create one that will use the existing HTML anchors as
markers and retrieve and display only the text string that starts
after a specified anchor, and ends just before then next anchor?

Ed
Jul 23 '05 #1
4 2293
In article <7e*************************@posting.google.com> ,
gg*****************@recursor.net enlightened us with...
I am building a glossary. Each letter of the alphabet has its own
HTML page, and each glossary entry on the page already has a unique
HTML anchor tag immediately to the left of it.

I've already learned how to do a Javascript pop up browser window. Is
there a way to create one that will use the existing HTML anchors as
markers and retrieve and display only the text string that starts
after a specified anchor, and ends just before then next anchor?

Ed


Like this?
Tested in NN7/IE6. No claims made for other browsers. Watch for word-wrap.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
<title> New Document </title>
<script type="text/javascript" language="javascript">
function checkIt(lnk)
{
alert(lnk.innerHTML);
}
</script>
</head>

<body>
<a href="someLink.html" onClick="checkIt(this);return false;">Text of link
</a>
</body>
</html>

--
--
~kaeli~
If a book about failures doesn't sell, is it a success?
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #2
On 26 Jul 2004 09:06:18 -0700, Ed wrote:
I've already learned how to do a
Javascript pop up browser window.


I suspect your 'true learning'
has yet to commence.. ;-)

--
Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology
Jul 23 '05 #3
Ed
kaeli <ti******@NOSPAM.comcast.net> wrote in message news:<MP************************@nntp.lucent.com>. ..
In article <7e*************************@posting.google.com> ,
Like this?
Tested in NN7/IE6. No claims made for other browsers. Watch for word-wrap.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
<title> New Document </title>
<script type="text/javascript" language="javascript">
function checkIt(lnk)
{
alert(lnk.innerHTML);
}
</script>
</head>

<body>
<a href="someLink.html" false;">Text of link
</a>
</body>
</html>

Kaeli,

Thanks for you fast response. When I tried this, it popped up a grey
alert box that contained the link description text ("Text of link" in
your example), but nothing from the page that I linked to
(someLink.html" in your example). Was that what it was supposed to
do?

What I was after was to open up a small new browser window which
contained only the text between two anchors on another page, e.g. the
link resides on page_one.html, and when clicked it pops up a small
browser window which contains only the text found between
page_two.html#firstanchor and page_two.html#secondanchor.

Any ideas?

Ed
Jul 23 '05 #4
In article <7e**************************@posting.google.com >,
gg*****************@recursor.net enlightened us with...
kaeli <ti******@NOSPAM.comcast.net> wrote in message news:<MP************************@nntp.lucent.com>. ..

Thanks for you fast response. When I tried this, it popped up a grey
alert box that contained the link description text ("Text of link" in
your example), but nothing from the page that I linked to
(someLink.html" in your example). Was that what it was supposed to
do?
Yes.

What I was after was to open up a small new browser window which
contained only the text between two anchors on another page, e.g. the
link resides on page_one.html, and when clicked it pops up a small
browser window which contains only the text found between
page_two.html#firstanchor and page_two.html#secondanchor.


Sorry, I misunderstood what you wanted.
I've been putzing around with using an IFRAME, but so far haven't gotten it
to work well in IE (issue with waiting for the contents to load and catching
that event before trying to read the contents) or work at all in NN6 (won't
let me reference the iframe with document.frames and won't let me access the
iframe document contents with getElementById).

I'd do this server-side, to be honest. Anything you do client-side is going
to be a JS hack to read and parse the contents of the file and won't be as
cross-browser as an internet app should be.

--
--
~kaeli~
Do not taunt Happy Fun Ball!
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: dave | last post by:
Hello, I've got a page, actually a friend does, that he'd like to update with his schedule for the week. THis is a simple html page, and he'd like to do this via a php script. Ideally one would...
3
by: dkalsow | last post by:
Good Morning, Does anyone have an example (in vb .net) of how I can bring down an internal web html page into a string variable and then search for a specific string. The web page is internal...
82
by: Eric Lindsay | last post by:
I have been trying to get a better understanding of simple HTML, but I am finding conflicting information is very common. Not only that, even in what seemed elementary and without any possibility...
1
by: mcmwhite | last post by:
Hi, Does anyone know how I can open a newly-created HTML page in a new window, using ASP.NET? Eg. I have an ASP.NET page which creates some new HTML, based on what the user has entered into a...
6
by: kklickman | last post by:
I've got a page with two columns: one floats left, the other doesn't float. The page displays fine in Netscape no matter what. In IE (both 6 and 7), it looks fine as long as the browser window is...
1
by: Ari Krupnik | last post by:
While working on a commercial product, I came up with a way to allow users to drag and drop bits of web pages into my site. This works regardless of whether the source is from my site or not, and...
8
by: Matsam | last post by:
Hi, I am using a HTML page as login page and my 2nd page is in ASP. I want to pass the values in the text boxes login name & password to the 2nd page and want to check its validity there. But I...
1
by: Reg | last post by:
I have a following code in HttpRequestListener's ProcessRequest method which is a Windows Console Application. I'm trying to read html page with browser (Opera) and html file contains tags to...
2
by: GoldenShiner | last post by:
hello, I have a c# application which after clicking a button in infopath form, creates an HTML file. I would like to open this page in a NEW window, instead of what is actually doing, opening into...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.