Menu

#231 Event error

open
5
2005-08-04
2003-07-10
Daniel Tiru
No

Hi!

I have a HTML button and a onclick event assigned to
that one.

parent.hb = new parent.HTMLButton
('submit','Login','Login');
parent.hb.addEventListener({
onclick:function(e){
var o=e.getSource();
parent.PostData
('frmLogin','response.asp');
}
});

When i click on the button one time, it works fine,
however when i click another time, it returns:
Error: Can't execute code from a freed script
Line: 77 in event.js
The line in event js looks like this:
if (this._listeners[i]["on"+type]) this._listeners[i]
["on"+type](e,args);
And my debugger marks this part:
this._listeners[i]["on"+type](e,args)

The script it calls works fine, i have tried it several times
without a HTMLButton, with just an ordinary button.

Hope this info helps out in solving this.
Regards
Daniel

Discussion

  • Raymond Irving

    Raymond Irving - 2003-07-11

    Logged In: YES
    user_id=696242

    This has to do with your code:

    onclick:function(e){
    var o=e.getSource();
    parent.PostData ('frmLogin','response.asp');

    This section of the code was created inside the ioelement's
    Iframe object. Whenever you send another post it will clear
    the content of the IFrame thus giving the error. The
    downloaded js code was not created within the scope of the
    main document but within the scope of the iframe object

    I've seen it before and I'm thinking of a way to resolve it.

    --
    Raymond Irving

     
  • Doug Melvin

    Doug Melvin - 2005-07-29

    Logged In: YES
    user_id=184788

    how about using the browser's namespace?
    I.E. top. instead of parent. could be the parent is being
    reinitialized on reload which is loosing all yer code.

    top.whatever="blagme" places a vaiable in the top-level
    window which swill not be erase when reloading the iframe
    inside that window

     
  • - 2005-08-04
    • assigned_to: nobody --> warp9pnt9
     
  • - 2005-08-04

    Logged In: YES
    user_id=706287

    Not sure I understand this. Because of all the references
    to parent, I guess we're in a child object? The HTMLButton
    is in the parent, and when the parent is submitted, then all
    the code in the children is wiped out? It'd help me to see
    a concrete example. I can probably discover the problem if
    I try, and if I get a server setup to run IOElement's server
    side. But since I don't have ASP, only PHP and Perl, then I
    have to get those versions working first. :p Resolution,
    is it an API or end-developer error? Or is this a valid
    condition people would expect to work? If so, perhaps the
    other namespace is an option, or at least a callback
    function to reinsert the above code into each new child
    namespace, if it really must be there. :-)

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.