Such a command as "onbeforeload"?
Such a command as "onbeforeload"?
am 14.11.2007 19:33:44 von Todd_Calhoun
Hi, I have a javascript popup which I want to happen BEFORE the rest of the
page loads. It's something for people to read while quite a heavy page
loads behind it.
I tried using 'onbeforeload' instead of 'onload' in the Body tag, but it
doesn't pop up at all then.
Any ideas?
Thanks.
Re: Such a command as "onbeforeload"?
am 14.11.2007 19:48:58 von it_says_BALLS_on_your forehead
On Nov 14, 2:33 pm, "CJS" wrote:
> Hi, I have a javascript popup which I want to happen BEFORE the rest of the
> page loads. It's something for people to read while quite a heavy page
> loads behind it.
>
> I tried using 'onbeforeload' instead of 'onload' in the Body tag, but it
> doesn't pop up at all then.
I didn't see such an event. But what are you trying to accomplish?
Perhaps there is a way to do what you require via another path.
Re: Such a command as "onbeforeload"?
am 14.11.2007 19:52:29 von it_says_BALLS_on_your forehead
On Nov 14, 2:48 pm, nolo contendere wrote:
> On Nov 14, 2:33 pm, "CJS" wrote:
>
> > Hi, I have a javascript popup which I want to happen BEFORE the rest of the
> > page loads. It's something for people to read while quite a heavy page
> > loads behind it.
>
> > I tried using 'onbeforeload' instead of 'onload' in the Body tag, but it
> > doesn't pop up at all then.
>
> I didn't see such an event. But what are you trying to accomplish?
> Perhaps there is a way to do what you require via another path.
This is untested, but may serve your needs.
http://www.codingforums.com/showthread.php?s=&threadid=15203
Re: Such a command as "onbeforeload"?
am 14.11.2007 20:01:52 von PointedEars
CJS wrote:
> Hi, I have a javascript popup which I want to happen BEFORE the rest of the
> page loads. It's something for people to read while quite a heavy page
> loads behind it.
If it is a popup window, it will be blocked. If it is something else,
loading it will only slow down or prevent loading of the other, more
important content; if it even works.
In any case, it is nothing that can be recommended. BTDT. You are far
better off with either reducing the size of the "heavy page", for example by
splitting it into several documents, and/or with structuring it better (for
example by avoiding layout tables in favor of CSS-positioned blocks) so that
the user can read the main content while it is loading.
F'up2 comp.lang.javascript
PointedEars
--
var bugRiddenCrashPronePieceOfJunk = (
navigator.userAgent.indexOf('MSIE 5') != -1
&& navigator.userAgent.indexOf('Mac') != -1
) // Plone, register_function.js:16
Re: Such a command as "onbeforeload"?
am 14.11.2007 20:12:33 von it_says_BALLS_on_your forehead
On Nov 14, 2:33 pm, "CJS" wrote:
> Hi, I have a javascript popup which I want to happen BEFORE the rest of the
> page loads. It's something for people to read while quite a heavy page
> loads behind it.
>
> I tried using 'onbeforeload' instead of 'onload' in the Body tag, but it
> doesn't pop up at all then.
>
> Any ideas?
>
You could start off by showing a loader of some sort (image, txt,
whatever) in a div (style="display: block;"), with your content in a
div (style="display: none;"), and onload, call a function that sets
the loader div to display: none and the content div to display: block.
Re: Such a command as "onbeforeload"?
am 15.11.2007 10:44:30 von Todd_Calhoun
"nolo contendere" wrote in message
news:1195066138.248524.40570@50g2000hsm.googlegroups.com...
> On Nov 14, 2:33 pm, "CJS" wrote:
>> Hi, I have a javascript popup which I want to happen BEFORE the rest of
>> the
>> page loads. It's something for people to read while quite a heavy page
>> loads behind it.
>>
>> I tried using 'onbeforeload' instead of 'onload' in the Body tag, but it
>> doesn't pop up at all then.
>
> I didn't see such an event. But what are you trying to accomplish?
> Perhaps there is a way to do what you require via another path.
Simply what I want to accomplish is the popup to come up *first* befoer any
other page elements load. It is complicated as to why, and other factors,
but that is what needs to happen.
The onload tag seems to open happen after the page has finished loading
completely, which is odd.
Re: Such a command as "onbeforeload"?
am 15.11.2007 10:45:06 von Todd_Calhoun
"nolo contendere" wrote in message
news:1195066349.321494.77410@d55g2000hsg.googlegroups.com...
> On Nov 14, 2:48 pm, nolo contendere wrote:
>> On Nov 14, 2:33 pm, "CJS" wrote:
>>
>> > Hi, I have a javascript popup which I want to happen BEFORE the rest of
>> > the
>> > page loads. It's something for people to read while quite a heavy page
>> > loads behind it.
>>
>> > I tried using 'onbeforeload' instead of 'onload' in the Body tag, but
>> > it
>> > doesn't pop up at all then.
>>
>> I didn't see such an event. But what are you trying to accomplish?
>> Perhaps there is a way to do what you require via another path.
>
> This is untested, but may serve your needs.
>
> http://www.codingforums.com/showthread.php?s=&threadid=15203
Thanks but that is not related to my request above to have a JS popup happen
as the first event before any other loading takes place.
Re: Such a command as "onbeforeload"?
am 15.11.2007 10:59:34 von Randy Webb
CJS said the following on 11/15/2007 4:44 AM:
[follow-up set to comp.lang.javascript]
> "nolo contendere" wrote in message
> news:1195066138.248524.40570@50g2000hsm.googlegroups.com...
>> On Nov 14, 2:33 pm, "CJS" wrote:
>>> Hi, I have a javascript popup which I want to happen BEFORE the rest of
>>> the
>>> page loads. It's something for people to read while quite a heavy page
>>> loads behind it.
>>>
>>> I tried using 'onbeforeload' instead of 'onload' in the Body tag, but it
>>> doesn't pop up at all then.
>> I didn't see such an event. But what are you trying to accomplish?
>> Perhaps there is a way to do what you require via another path.
>
> Simply what I want to accomplish is the popup to come up *first* befoer any
> other page elements load. It is complicated as to why, and other factors,
> but that is what needs to happen.
>
> The onload tag seems to open happen after the page has finished loading
> completely, which is odd.
Want something to happen during load? Don't use onload. It fires after
the element has completely loaded. Why you would find it odd that an
event that is defined to trigger after the element is completely loaded
only fires after the element is completely loaded is, well, odd to say
the least.
--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Answer:It destroys the order of the conversation
Question: Why?
Answer: Top-Posting.
Question: Whats the most annoying thing on Usenet?
Re: Such a command as "onbeforeload"?
am 15.11.2007 15:12:18 von it_says_BALLS_on_your forehead
On Nov 15, 5:44 am, "CJS" wrote:
> "nolo contendere" wrote in message
>
> news:1195066138.248524.40570@50g2000hsm.googlegroups.com...
>
> > On Nov 14, 2:33 pm, "CJS" wrote:
> >> Hi, I have a javascript popup which I want to happen BEFORE the rest of
> >> the
> >> page loads. It's something for people to read while quite a heavy page
> >> loads behind it.
>
> >> I tried using 'onbeforeload' instead of 'onload' in the Body tag, but it
> >> doesn't pop up at all then.
>
> > I didn't see such an event. But what are you trying to accomplish?
> > Perhaps there is a way to do what you require via another path.
>
> Simply what I want to accomplish is the popup to come up *first* befoer any
> other page elements load. It is complicated as to why, and other factors,
> but that is what needs to happen.
>
> The onload tag seems to open happen after the page has finished loading
> completely, which is odd.
Hmm, a friend of mine uses the technique I mentioned and it works
fine. Have you tried the swapping thing? It is precisely
*because* the onload happens *after* the page has loaded that you can
use that as the event to trigger the
display swap.
And while the page is in the process of loading, the onload event has
not fired yet, but the loader div is being displayed. I realize that
this doesn't give you the popup you requested, but it serves as a
solution to your ultimate goal of providing the user with feedback
that a heavy page is loading.
HTH
Re: Such a command as "onbeforeload"?
am 15.11.2007 15:30:25 von it_says_BALLS_on_your forehead
On Nov 15, 5:44 am, "CJS" wrote:
> "nolo contendere" wrote in message
>
> news:1195066138.248524.40570@50g2000hsm.googlegroups.com...
>
> > On Nov 14, 2:33 pm, "CJS" wrote:
> >> Hi, I have a javascript popup which I want to happen BEFORE the rest of
> >> the
> >> page loads. It's something for people to read while quite a heavy page
> >> loads behind it.
>
> >> I tried using 'onbeforeload' instead of 'onload' in the Body tag, but it
> >> doesn't pop up at all then.
>
> > I didn't see such an event. But what are you trying to accomplish?
> > Perhaps there is a way to do what you require via another path.
>
> Simply what I want to accomplish is the popup to come up *first* befoer any
> other page elements load. It is complicated as to why, and other factors,
> but that is what needs to happen.
>
> The onload tag seems to open happen after the page has finished loading
> completely, which is odd.
Try something like this:
hi there
Re: Such a command as "onbeforeload"?
am 15.11.2007 16:51:31 von Gregor Kofler
nolo contendere meinte:
>
>
>
>