R
Richard Maher
Hi,
Now that I am aware that JS on a page in Frame A can directly call a
function on a page in Frame B, I no longer have to continue with my
frameB.location.reload() fudge in order to get some code to run in B's
context. This is fantastic news, and I'm having a ball!
But before running off with all my convert's zeal and converting all my
<script src="common.js"> copy-books to direct parent.frame.function() calls
I'd like to pause for a moment as ask everyone if you think it makes sense?
If I was on the mainframe there would be no question and I'd go for the
Shareable-Image/DLL 99.8% of the time; everyone sees the same copy in memory
and they pick up any new version the next time they run. But does it make
that much difference, here in JS linkerless interpreter-land, that each page
has its own local copy of function(s) and data?
To pose the question another way, If a given function is stateless
(non-variant is the closest SQL expression that comes to mind) is there any
point in FrameB calling a parent.frameA.function1 rather than having it's
own copy of function 1? Now if function1 was stateful and maybe keeping a
counter of all calls from all frames, then clearly there are logic reasons
why this keeper of the Global knowledge should have only one instance, but
if it just takes some parameters and returns a result (or affects the
screen) then who cares?
Few more bytes of memory? Extract another.JS file to upload? (but what about
the first time being cached?) Neatness? Goodness?
Question 2:
Speaking of uploading, If I have three frames each with their own page, is
there a predicable ONLOAD sequence of the frame/page loads? (I take it http
can multithread this if it chooses? but not the script execution) I know
that trying to access an Applet method looks like a bit of a synch point,
but a lot of what I want to do/reference in Frame B's load function is not
available 'cos frame A hasn't constructed all it's objects yet. If ONLOAD
happens too early for me, can I have a init() function in each frame and
then call it from the onload() event in the driving/mainline Frame? But then
there's that timing race condition again, or is there?
I just don't want to have to re-initialize a whole lot of variables
needlessley every time a frame becomes visible/active.
Thanks for any help.
Cheers Richard Maher
Now that I am aware that JS on a page in Frame A can directly call a
function on a page in Frame B, I no longer have to continue with my
frameB.location.reload() fudge in order to get some code to run in B's
context. This is fantastic news, and I'm having a ball!
But before running off with all my convert's zeal and converting all my
<script src="common.js"> copy-books to direct parent.frame.function() calls
I'd like to pause for a moment as ask everyone if you think it makes sense?
If I was on the mainframe there would be no question and I'd go for the
Shareable-Image/DLL 99.8% of the time; everyone sees the same copy in memory
and they pick up any new version the next time they run. But does it make
that much difference, here in JS linkerless interpreter-land, that each page
has its own local copy of function(s) and data?
To pose the question another way, If a given function is stateless
(non-variant is the closest SQL expression that comes to mind) is there any
point in FrameB calling a parent.frameA.function1 rather than having it's
own copy of function 1? Now if function1 was stateful and maybe keeping a
counter of all calls from all frames, then clearly there are logic reasons
why this keeper of the Global knowledge should have only one instance, but
if it just takes some parameters and returns a result (or affects the
screen) then who cares?
Few more bytes of memory? Extract another.JS file to upload? (but what about
the first time being cached?) Neatness? Goodness?
Question 2:
Speaking of uploading, If I have three frames each with their own page, is
there a predicable ONLOAD sequence of the frame/page loads? (I take it http
can multithread this if it chooses? but not the script execution) I know
that trying to access an Applet method looks like a bit of a synch point,
but a lot of what I want to do/reference in Frame B's load function is not
available 'cos frame A hasn't constructed all it's objects yet. If ONLOAD
happens too early for me, can I have a init() function in each frame and
then call it from the onload() event in the driving/mainline Frame? But then
there's that timing race condition again, or is there?
I just don't want to have to re-initialize a whole lot of variables
needlessley every time a frame becomes visible/active.
Thanks for any help.
Cheers Richard Maher