Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Find web page coordinates using java?

Reply
Thread Tools

Find web page coordinates using java?

 
 
Jimi Hullegård
Guest
Posts: n/a
 
      11-21-2005
Hi

Does anyone of you know of a java webbrowser plugin/component that gives me
access to the coordinates of elements in a rendered page?
I want to draw some real time animation on top of an html page, using the
coordinates of some of the links.
Not server side, but client side. And not using javascript or flash. So I'm
thinking either an applet, or a standalone java application with some
broswer plugin that makes it act like a regular browser.

I have tried JRex (http://jrex.mozdev.org/), and according to the API there
is a method that will give the coordinates of an anchor
(http://jrex.mozdev.org/docs/api/org/...orElement.html)
but that method returns an empty string. I have asked about this in the jrex
news group and mailing list, but no one has answered.

So, does anyone here know how to make JRex give me the coordinates? Or some
other solution or ideas?

Regards
/Jimi


 
Reply With Quote
 
 
 
 
Andrew Thompson
Guest
Posts: n/a
 
      11-21-2005
Jimi Hullegård wrote:

> So, does anyone here know how to make JRex give me the coordinates? Or some
> other solution or ideas?


<requires the user to run it in 'trusted' mode>
Frame the page you ultimately want in a frameset
where there is a hidden frame containing an applet
and JS of your devising. The JS determines the mouse
position and hands it to the applet, the applet
communicates that back to ..whatever needs to know.
<requires the user to run it in 'trusted' mode>

HTH

--
Andrew Thompson
physci, javasaver, 1point1c, lensescapes - athompson.info/andrew
Currently accepting short and long term contracts - on Earth.
 
Reply With Quote
 
 
 
 
jimi_usenet@hotmail.com
Guest
Posts: n/a
 
      11-21-2005
Andrew Thompson wrote:
> Jimi Hullegård wrote:
>
> > So, does anyone here know how to make JRex give me the coordinates? Or some
> > other solution or ideas?

>
> <requires the user to run it in 'trusted' mode>
> Frame the page you ultimately want in a frameset
> where there is a hidden frame containing an applet
> and JS of your devising. The JS determines the mouse
> position and hands it to the applet, the applet
> communicates that back to ..whatever needs to know.
> <requires the user to run it in 'trusted' mode>


Sorry, I think I maybe was unclear. I need the coordinates of the
anchor elements on the rendered html page, not the mouse coordinates

/Jimi

 
Reply With Quote
 
Andrew Thompson
Guest
Posts: n/a
 
      11-21-2005
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:

> Andrew Thompson wrote:
>
>>Jimi Hullegård wrote:
>>
>>
>>>So, does anyone here know how to make JRex give me the coordinates? Or some
>>>other solution or ideas?

>>
>><requires the user to run it in 'trusted' mode>
>>Frame the page you ultimately want in a frameset
>>where there is a hidden frame containing an applet
>>and JS of your devising. The JS determines the mouse
>>position and hands it to the applet, the applet
>>communicates that back to ..whatever needs to know.

>
> Sorry, I think I maybe was unclear. I need the coordinates of the
> anchor elements on the rendered html page, not the mouse coordinates


AFAIU, JS can navigate the page DOM and give you co-ords
of each of the page elements, as well.

--
Andrew Thompson
physci, javasaver, 1point1c, lensescapes - athompson.info/andrew
Currently accepting short and long term contracts - on Earth.
 
Reply With Quote
 
Jimi Hullegård
Guest
Posts: n/a
 
      11-21-2005
"Andrew Thompson" <(E-Mail Removed)> wrote in message
news:dHhgf.23264$(E-Mail Removed)...
> (E-Mail Removed) wrote:
>
>> Andrew Thompson wrote:
>>
>>>Jimi Hullegård wrote:
>>>
>>>
>>>>So, does anyone here know how to make JRex give me the coordinates? Or
>>>>some
>>>>other solution or ideas?
>>>
>>><requires the user to run it in 'trusted' mode>
>>>Frame the page you ultimately want in a frameset
>>>where there is a hidden frame containing an applet
>>>and JS of your devising. The JS determines the mouse
>>>position and hands it to the applet, the applet
>>>communicates that back to ..whatever needs to know.

>>
>> Sorry, I think I maybe was unclear. I need the coordinates of the
>> anchor elements on the rendered html page, not the mouse coordinates

>
> AFAIU, JS can navigate the page DOM and give you co-ords
> of each of the page elements, as well.


Thanks for the tip. I looked into that, and found a good page about that
(http://webdeveloper.com/advhtml/ " Determining Element Page Coordinates").

So now I have a javascript that gives me the information I need. But I can't
seem to figure out how to use this javascript with JRex. I have read about
the JSObject, but all I see is examples on how to call javascript functions
that are already "in" the html page. But my javascript is in a separate
js-file. How do I "insert" that file into the html page, so I then can call
my own methods on that page? I don't want to have to edit the html-page.

Regards
/Jimi


 
Reply With Quote
 
Andrew Thompson
Guest
Posts: n/a
 
      11-24-2005
Jimi Hullegård wrote:
....
> So now I have a javascript that gives me the information I need. But I can't
> seem to figure out how to use this javascript with JRex. I have read about
> the JSObject, but all I see is examples on how to call javascript functions
> that are already "in" the html page. But my javascript is in a separate
> js-file. How do I "insert" that file into the html page, so I then can call
> my own methods on that page? I don't want to have to edit the html-page.


You need to introduce the JS into the HTML somehow,
You can use a single line reference to the file containing
the JS, or if the tarrget oage is beyond being edited, you need
to use the frames based approach I mentioned earlier, and inport
the JS into another frame in that frameset.

[ But see the comp.lang.javasrcipt people for the details. ]

--
Andrew Thompson
physci, javasaver, 1point1c, lensescapes - athompson.info/andrew
Currently accepting short and long term contracts - on Earth.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
I am trying to find coordinates for pampa texas, but i do not knowthe exact street address upandattem2002@yahoo.com Computer Support 1 12-15-2007 01:45 AM
Set a DIV to be a footer: lowest coordinates in a page pamelafluente@libero.it Javascript 26 08-24-2006 12:54 PM
How to find out iframe's coordinates in parent? Vladimir Eltchinov Javascript 0 08-20-2003 09:12 AM
Converting canvas coordinates to window coordinates in tkinter......... Suresh Kumar Python 0 07-04-2003 10:14 AM
Converting canvas coordinates to window coordinates....... Suresh Kumar Python 0 07-03-2003 04:53 AM



Advertisments