We have initializion _javascript_ code in our .script file like this:


<initialization>
    var ${blah} = new Blah();
</initialization>  


Also in our HTML we have a way to connect to ${blah}.  I've left those details out for simplicity.

At the end of the day the HTML snippets in the browser are like:

<a href="" >
<script>
var blah = new Blah();
</script>

The situation:
All good so far, now we do a Tacos Submit.

What we find is that the Tacos response causes the <initialization> code to happen again.  Hence,
var blah = new Blah();

happens again.

So first question is:

1. Why does Tacos do an initialization again?

Now what's even more interesting is that even though
var blah = new Blah();
happens again, we observe that the

<a href="" blah.foo()"/>

still points to the instance of blah that got created on THE FIRST page load !!

We strongly suspect that this might be because the initialization happening in Tacos subsequently
is an eval() of a function and hence the second time:

var blah = new Blah();

has blah scoped in the function, and hence doesn't affect the <a href="" >
So our second question

2. Is our hypothesis of this eval() and scoping correct??
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Tacos-devel mailing list
Tacos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tacos-devel

Reply via email to