Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Calling javascript functions from a java application

Reply
Thread Tools

Calling javascript functions from a java application

 
 
arun.hallan@gmail.com
Guest
Posts: n/a
 
      02-15-2008
Hi,

Is it possible to link into a javascript DOM online from a java
application on my desktop, so i can hook into the functions which
return data. There is a website which displays data but i would like
to try and hook into it so i can retrieve data in a more efficient
manner.

Regards
 
Reply With Quote
 
 
 
 
Bart Van der Donck
Guest
Posts: n/a
 
      02-15-2008
arun.hal...@gmail.com wrote:

> Is it possible to link into a javascript DOM online from a java
> application on my desktop, so i can hook into the functions which
> return data. There is a website which displays data but i would like
> to try and hook into it so i can retrieve data in a more efficient
> manner.


I don't believe this is possible because the remote resource will
always return the raw (javascript) code, and not the result of the
function. Even when the remote function would be executed (e.g. by
passing a parameter in the query string from DeskTop), this does not
affect the output.

When Java uses a built-in browser (or launches MSIE), the remote
javascript code cannot leave its execution environment (which is the
browser in this case).

The traditional approach is to load the data as a whole, and then
manipulate it from within Java. For example, if the output file is an
XML-file, use the Java routines to access its DOM.

Hope this helps,

--
Bart
 
Reply With Quote
 
 
 
 
Thomas 'PointedEars' Lahn
Guest
Posts: n/a
 
      02-17-2008
wrote:
> Is it possible to link into a javascript DOM online from a java
> application on my desktop, so i can hook into the functions which
> return data. There is a website which displays data but i would like
> to try and hook into it so i can retrieve data in a more efficient
> manner.


Please restate your request.


PointedEars
--
Use any version of Microsoft Frontpage to create your site.
(This won't prevent people from viewing your source, but no one
will want to steal it.)
-- from <http://www.vortex-webdesign.com/help/hidesource.htm>
 
Reply With Quote
 
arun.hallan@gmail.com
Guest
Posts: n/a
 
      02-18-2008
On Feb 15, 12:23*pm, Bart Van der Donck <b...@nijlen.com> wrote:
> arun.hal...@gmail.com wrote:
> > Is it possible to link into a javascript DOM online from a java
> > application on my desktop, so i can hook into the functions which
> > return data. There is a website which displays data but i would like
> > to try and hook into it so i can retrieve data in a more efficient
> > manner.

>
> I don't believe this is possible because the remote resource will
> always return the raw (javascript) code, and not the result of the
> function. Even when the remote function would be executed (e.g. by
> passing a parameter in the query string from DeskTop), this does not
> affect the output.
>
> When Java uses a built-in browser (or launches MSIE), the remote
> javascript code cannot leave its execution environment (which is the
> browser in this case).
>
> The traditional approach is to load the data as a whole, and then
> manipulate it from within Java. For example, if the output file is an
> XML-file, use the Java routines to access its DOM.
>
> Hope this helps,
>
> --
> *Bart


That does help, thanks.

What do you mean by "load the data as a whole, and then manipulate it
from within Java" - are you saying that i can load the document in
java and then manipulate the javascript methods?

I read that you can build a java applet to access the javascript
within a page, but i dont want to go hacking around into someone's
webpage.

Thanks again

 
Reply With Quote
 
Bart Van der Donck
Guest
Posts: n/a
 
      02-19-2008
arun.hal...@gmail.com wrote:

> What do you mean by "load the data as a whole, and then manipulate it
> from within Java" - are you saying that i can load the document in
> java and then manipulate the javascript methods?


It depends on where & how the java program works. You said that it
runs from your desktop and fetches a remote resource over the
internet. In that case, the normal scenario would be to fire a GET/
POST request and receive the full response at that desktop application
(whatever format/output that may be).

> I read that you can build a java applet to access the javascript
> within a page, but i dont want to go hacking around into someone's
> webpage.


Yes, but this is a considerably different situation. When the java
applet and the javascripts are in the same web page, they might
influence each other. I'm not a java sultan but i heard of the
MAYSCRIPT-argument for such applets.

--
Bart
 
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
Variadic functions calling variadic functions with the argument list, HLL bit shifts on LE processors Ross A. Finlayson C Programming 19 03-10-2005 03:57 AM
Function pointers, variable argument functions calling other variable-argument functions (sort of) S?ren Gammelmark C Programming 1 01-07-2005 09:41 PM
please help me in distinguish redefining functions, overloading functions and overriding functions. Xiangliang Meng C++ 1 06-21-2004 03:11 AM
simulating/calling javascript functions programmatically =?Utf-8?B?WVI=?= ASP .Net 4 01-27-2004 05:11 AM
External inline functions calling internal inline functions Daniel Vallstrom C Programming 2 11-21-2003 01:57 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57