Javascript in loop

Previous Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Javascript in loop

Lucas Gonçalves
L have a problem with javascript very strange!
My page have a button
<input type="button" name="evento" value="F7-Novo"
onclick="setBotaoAcao(getBotaoArray('INCLUIR'));
redirect('/ecp/aplicacao.do?evento=x');">
and when click on it, return a exception java.lang.stackoverflow!
When l was analyzing l found the problem in DomNode Class in this method

        public Object getScriptObject() {
        if (scriptObject_ == null) {
            scriptObject_ = ((SimpleScriptable)
getPage().getScriptObject()).makeScriptableFor(this);
        }
        return scriptObject_;
    }
This method was called by ClickableElement class in public Page Click(){..}
It´s strange because this method ever throw a exception(when scriptObject is
null on the first time, stop and analize it);
What this method do?
L can´t understand how everybody can use javascript onclick event, if this
method is wrong!
HELP ME, l´m pulling out my hair!!


Lucas Gonçalves - PowerLogic




-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP,
AMD, and NVIDIA.  To register visit http://www.hp.com/go/dualwebinar
_______________________________________________
Htmlunit-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/htmlunit-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Javascript in loop

Brad Clarke
The only way that little bit of code could blow stack is if you clicked the Page,
which doesn't seem like a very valid thing to do and doesn't sound very likely.

Brad C


--- Lucas Gonçalves <[hidden email]> wrote:

> L have a problem with javascript very strange!
> My page have a button
> <input type="button" name="evento" value="F7-Novo"
> onclick="setBotaoAcao(getBotaoArray('INCLUIR'));
> redirect('/ecp/aplicacao.do?evento=x');">
> and when click on it, return a exception java.lang.stackoverflow!
> When l was analyzing l found the problem in DomNode Class in this method
>
> public Object getScriptObject() {
>         if (scriptObject_ == null) {
>             scriptObject_ = ((SimpleScriptable)
> getPage().getScriptObject()).makeScriptableFor(this);
>         }
>         return scriptObject_;
>     }
> This method was called by ClickableElement class in public Page Click(){..}
> It´s strange because this method ever throw a exception(when scriptObject is
> null on the first time, stop and analize it);
> What this method do?
> L can´t understand how everybody can use javascript onclick event, if this
> method is wrong!
> HELP ME, l´m pulling out my hair!!
>
>
> Lucas Gonçalves - PowerLogic



-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP,
AMD, and NVIDIA.  To register visit http://www.hp.com/go/dualwebinar
_______________________________________________
Htmlunit-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/htmlunit-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Javascript in loop

Marc Guillemot
In reply to this post by Lucas Gonçalves
Hi,

in htmlunit DOM objects have associated JavaScript host objects for javascript execution. The js host objects are only
created when needed, therefore getScriptObject(). It seem that in you case the logic of this creation fails. Can you try
to minimize the code producing the error and then open a but issue?

Marc.

Lucas Gonçalves wrote:

> L have a problem with javascript very strange!
> My page have a button
> <input type="button" name="evento" value="F7-Novo"
> onclick="setBotaoAcao(getBotaoArray('INCLUIR'));
> redirect('/ecp/aplicacao.do?evento=x');">
> and when click on it, return a exception java.lang.stackoverflow!
> When l was analyzing l found the problem in DomNode Class in this method
>
> public Object getScriptObject() {
>         if (scriptObject_ == null) {
>             scriptObject_ = ((SimpleScriptable)
> getPage().getScriptObject()).makeScriptableFor(this);
>         }
>         return scriptObject_;
>     }
> This method was called by ClickableElement class in public Page Click(){..}
> It´s strange because this method ever throw a exception(when scriptObject is
> null on the first time, stop and analize it);
> What this method do?
> L can´t understand how everybody can use javascript onclick event, if this
> method is wrong!
> HELP ME, l´m pulling out my hair!!
>
>
> Lucas Gonçalves - PowerLogic
>
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
> July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
> core and dual graphics technology at this free one hour event hosted by HP,
> AMD, and NVIDIA.  To register visit http://www.hp.com/go/dualwebinar
> _______________________________________________
> Htmlunit-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/htmlunit-user
>



-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP,
AMD, and NVIDIA.  To register visit http://www.hp.com/go/dualwebinar
_______________________________________________
Htmlunit-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/htmlunit-user
Loading...