[Javascript] Onload and onunload spinner

Aaron Bassett aaronbassett at gmail.com
Fri Jan 5 12:37:33 CST 2007


Could you attach a random query string variable to the end of the links?
So even if it is the same page it will change the src like have 2 links to
the same page but with a random variable such as

mypage.php?rnd=3r09fj340f
mypage.php?rnd=sdfojh30sd

or are these links within the frame which you have no control over?

The only other way that comes to mind atm is to use a server side proxy. All
links actually point at the proxy and pass the correct link url in as a
param. The proxy does a get on the param page and displays it in the frame.
That way you could locate the proxy page on the same domain so javascript
could interact with it and you could include additional code in the page to
trigger functions in the page holding the frame? (long way round for a
shortcut I know - lol!!)

Aaron

On 1/5/07, Terry Riegel <riegel at clearimageonline.com> wrote:
>
> Aaron,
> Thanks for the idea. I had tried that earlier, the problem is the scr
> attribute doesn't change when the same page is being loaded again as is the
> case in my application.
>
> Terry
>
>
> On Jan 5, 2007, at 12:18 PM, Aaron Bassett wrote:
>
> When you load a new page into the frame it should change the frames src
> attribute. You can have a function that checked ever Xsecs to see if the
> last known and current src are different. If they are start spinner.
>
> Then on the load event change the last known to current and stop the
> spinner.
>
> Might be another way of approaching it??
>
>
>
> On 1/5/07, Terry Riegel <riegel at clearimageonline.com > wrote:
> >
> > Tobias,
> >
> > Thanks for the response, but the problem is I do not know what is
> > going to be displayed in the "listened to" frame and do not have
> > control over its html (it is a filemanager). I do have a similar
> > working solution for the pages I do control.
> >
> > The solution I posted a few minutes ago doesn't care what is in the
> > "listened to" frame, it could be an html page or an image or anything.
> >
> > Basically my solution relies on the onload event as the onunload
> > event doesn't seem to fire for a frameset. So I only have to control
> > when I turn on the spinner. It will always be turned off when the
> > content loads into the page.
> >
> > Thanks for the reply.
> >
> >
> > Terry Riegel
> >
> >
> >
> > On Jan 5, 2007, at 9:18 AM, Tobias Parent wrote:
> >
> > > Actually, this may not be as painful as I thought, although it IS
> > > kludgy. Back about nine years ago, I'd done something similar - a
> > > page with four frames, one of which was simply a status list. What
> > > happens is, the frame you want to do the 'listening' (the one to be
> > > affected by the onLoad and onUnLoad), simply listens to a variable
> > > set in the parent frame (the first common parent to both frames).
> > > The frame to be listened to sets the variable as needed, so onLoad
> > > sets it to 'Complete', while onUnload sets it to 'Updating...'.
> > > This is just a concept, no proof to back it. Thought this through
> > > in the shower, and it seems workable. Sort of a modification of the
> > > 'Observer' pattern, somewhat.
> > >
> > > Regards!
> > > -Toby Parent
> > >   http://www.tobytheballoonguy.com/
> > >
> > >> Terry Riegel wrote:
> > >>> Well, no use beating a dead horse. I am guessing this problem is
> > >>> not doable? I for one have spent way to much time on it.
> > >>>
> > >>> Thanks,
> > >>>
> > >>> Terry
> > >>>
> > >>>
> > >>> On Jan 4, 2007, at 10:32 AM, Terry Riegel wrote:
> > >>>
> > >>>> It may not be possible, but I am looking for a way to trigger an
> > >>>> event everytime a web connection starts, then another event when
> > >>>> it finishes.
> > >>>>
> > >>>> I have a Frames based page like...
> > >>>>
> > >>>>   +---------------------------+
> > >>>>   |buttons                *   |
> > >>>>   +---------------------------+
> > >>>>   |path                       |
> > >>>>   +-------+-------------------+
> > >>>>   |browse |details            |
> > >>>>   |       |                   |
> > >>>>   |       |                   |
> > >>>>   |       |                   |
> > >>>>   +-------+-------------------+
> > >>>>
> > >>>> I am trying to figure out how to have "buttons" monitor activity
> > >>>> on "details" when a page is requested turn on the spinner, when
> > >>>> it is loaded turn off the spinner. Onload and onunload do not
> > >>>> seem to be consistent for this. The content in details is from
> > >>>> the same domain as all of the other pages, but will not be
> > >>>> managed by this, so adding js to this page will not work.
> > >>>>
> > >>>> Any Ideas?
> > >>>>
> > >>>>
> > >>>> Terry
> > >>>>
> > >>>>
> > >>>>
> > >>>> On Jan 3, 2007, at 2:32 PM, Terry Riegel wrote:
> > >>>>
> > >>>>> This is what I have that fires sometimes.
> > >>>>>
> > >>>>> top.frames['details'].window.onload=top.frames['browse'].a;
> > >>>>> top.frames['details'].window.onunload=top.frames['browse'].b;
> > >>>>>
> > >>>>> My js library loads in the browse frame, and the a function
> > >>>>> turns the spinner off, the b turns it on.
> > >>>>>
> > >>>>> Terry
> > >>>>>
> > >>>>>
> > >>>>> On Jan 3, 2007, at 2:08 PM, Terry Riegel wrote:
> > >>>>>
> > >>>>>> Hello,
> > >>>>>>
> > >>>>>> I have an application that uses frames. I would like to set
> > >>>>>> one frame to monitor what is going on in the other and turn a
> > >>>>>> spinner on when it unloads, and turn it off when it loads. any
> > >>>>>> quick thoughts on how I should proceed.
> > >>>>>>
> > >>>>>> Terry
> > >>>>>> _______________________________________________
> > >>>>>> Javascript mailing list
> > >>>>>> Javascript at LaTech.edu
> > >>>>>> https://lists.LaTech.edu/mailman/listinfo/javascript
> > >>>>>
> > >>>>> _______________________________________________
> > >>>>> Javascript mailing list
> > >>>>> Javascript at LaTech.edu
> > >>>>> https://lists.LaTech.edu/mailman/listinfo/javascript
> > >>>>
> > >>>> _______________________________________________
> > >>>> Javascript mailing list
> > >>>> Javascript at LaTech.edu
> > >>>> https://lists.LaTech.edu/mailman/listinfo/javascript
> > >>>
> > >>> _______________________________________________
> > >>> Javascript mailing list
> > >>> Javascript at LaTech.edu
> > >>> https://lists.LaTech.edu/mailman/listinfo/javascript
> > >>
> > >
> > > _______________________________________________
> > > Javascript mailing list
> > > Javascript at LaTech.edu
> > > https://lists.LaTech.edu/mailman/listinfo/javascript
> >
> > _______________________________________________
> > Javascript mailing list
> > Javascript at LaTech.edu
> > https://lists.LaTech.edu/mailman/listinfo/javascript
> >
>
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript
>
>
>
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20070105/65920654/attachment.htm>


More information about the Javascript mailing list