Join the AMA (Ask Me Anything) with the Firefox leadership team to celebrate Firefox 20th anniversary and discuss Firefox’s future on Mozilla Connect. Mark your calendar on Thursday, November 14, 18:00 - 20:00 UTC!

Шукати в статтях підтримки

Остерігайтеся нападів зловмисників. Mozilla ніколи не просить вас зателефонувати, надіслати номер телефону у повідомленні або поділитися з кимось особистими даними. Будь ласка, повідомте про підозрілі дії за допомогою меню “Повідомити про зловживання”

Докладніше

Ця тема перенесена в архів. Якщо вам потрібна допомога, запитайте.

Onload event

  • 3 відповіді
  • 3 мають цю проблему
  • 36 переглядів
  • Остання відповідь від finitarry

more options

There is an onload event that triggers when all page content is loaded. However, this event does not trigger when site is not avaible (timeout, server not found etc). Is there any way to force post this event trigger in FF - without having access to the site source ?

Small example:

<html>
<body>
<div id="loading">
Page Loading Please Wait One Moment...
</div>
<iframe src="http://google.com" onload="javascript:document.getElementById('loading').innerHTML = 'Page Loaded';">
</iframe>
</body>
</html>

This will trigger the onload event, however, this will not:

<html>
<body>
<div id="loading">
Page Loading Please Wait One Moment...
</div>
<iframe src="http://google.abc" onload="javascript:document.getElementById('loading').innerHTML = 'Page Loaded';">
</iframe>
</body>
</html>
There is an onload event that triggers when all page content is loaded. However, this event does not trigger when site is not avaible (timeout, server not found etc). Is there any way to force post this event trigger in FF - without having access to the site source ? Small example: <br /> <pre><nowiki><html> <body> <div id="loading"> Page Loading Please Wait One Moment... </div> <iframe src="http://google.com" onload="javascript:document.getElementById('loading').innerHTML = 'Page Loaded';"> </iframe> </body> </html> </nowiki></pre> This will trigger the onload event, however, this will not: <br /> <pre><nowiki><html> <body> <div id="loading"> Page Loading Please Wait One Moment... </div> <iframe src="http://google.abc" onload="javascript:document.getElementById('loading').innerHTML = 'Page Loaded';"> </iframe> </body> </html></nowiki></pre>

Змінено cor-el

Усі відповіді (3)

more options

Onload is a javascript command. Onload events happen when a page is loaded and the code is being rendered. Of course, if the page did not load, the onload will not happen.

more options

Yes, that's pretty much same what Ive written. Still - my question is unanswered.

more options

You normally cannot have a javascript event happening without loading and using the web page code that tells the browser to either follow a script command if it is an inline script or to load and execute an external javascript file. You can put javascript code directly into the address bar, and in fact that is what bookmarklets do, but that is limited to one line.