[links-list] Re: javascript, was Re: Re: Cookies

Jonas Fonseca fonseca at diku.dk
Sun May 5 08:30:45 PDT 2002

On Sun, May 05, 2002 at 10:22:06AM +0200, clemensF wrote:
> > Jonas Fonseca:
> > But if this javascript code 
> > [...]
> > So it's ok to have <p> tags inside <script> strings but not <td>. 
> you seem to have quite some javascript knowledge :)  may i ask something?

Let me point out that I'm only trying to figure out what is going on.
I've little experience with javascript but will try my best. :)

> there are many sites out there that wouldn't need any javascript, but
> perhaps the market oeconomix see to it, that always the most expensive
> canons are used to swat a fly.

Hehe ... you don't think the goal justify the mean ? More living (and
annoying) webpages. ;)

> my problem is this:  i come across sites that make popups appear using js. 
> they define functions that do nothing else but call some normal HTML page. 
> this page is there and could be called easily with any browser that can
> find it.
> could i use lua to handle this special situation?  eg. lynx can use rules
> that make it appear to do js, but only for sites whose structure is known.

I think you could. The function you would make lua handle is the 
window.open(url, name, feature, replace). All arguments are optional but
I guess only the first is interesting. So the regex for this could end
being pretty ugly. ;)

> i don't want a general mechanism, but for the two sites i'm interested in,
> there surely is a way to view them, especially as elinks has an embedded
> lua interpreter, which lynx has not.

If you give a pointer I could check out the javascript ...

> how are the base URL's typically set up, which are used by js routines to
> tack on some URL piece?  if i know that, i could propably script it myself.

I would presume that URLs are set up by the browsers 'base'. Ok there's
a lot of library functions the js could be calling so I really don't know.

Btw. if javascript should be an option in the future a possible way
could be with SpiderMonkey[1]. It is a C implementation of JavaScript[2].
This might be easier to integrate than the java implementation mentioned 
in the TODO file. Possibly also making a more standardized interface towards 
scripting based on how lua is done now. This could be very interesting.

Make it possible to do ruby or bash scripts in HTML pages. Making links
a kind of webshell engine.

[1] http://www.mozilla.org/js/spidermonkey
[2] Don't know if the license is a problem though.
Jonas Fonseca
Unsubscribe: send email to links-list-request at linuxfromscratch.org
and put unsubscribe in the subject header of the message

More information about the links-list mailing list