What triggers the onerror event handler for object tags in Internet Explorer?

After conducting tests on embedded flash widgets, it has come to my attention that the onerror event, when used with an object tag, may not be compatible across all browsers. However, we are noticing that Internet Explorer users are encountering this handler quite frequently.

I am aware that this handler is typically triggered when a SWF file fails to load due to reasons such as a 404 error, 410 error, or network issue. Are there any other circumstances in which this event might be called?

Considering these widgets are not created by us, could it be possible for an onerror event to be initiated from within the embedded flash file? This could explain why we are observing this behavior.

Additionally, is there a way to gather more information about the cause of the onerror event when it occurs?

In summary, our main concern is whether we can confidently assume that if an onerror event is triggered from an object tag, it indicates a failed SWF loading process, allowing us to attempt reloading it from a different URL. We want to avoid unnecessarily reloading the SWF if onerror was activated for a reason unrelated to loading failure.

Some extra details:

We are utilizing the Flash Satay method for embedding flash and simply attaching the onerror attribute to the object tag like so:

<object .... onerror="ourAjaxLogFunction()">

Thank you for your assistance.

Answer №1

The official documentation on the topic of onerror specifically states (emphasis added):

In order to trigger this function, you must induce one of the following errors:

  • A run-time script error, like an invalid object reference or a security breach.

  • An error during the download of an element, like an image.

  • This is new for Internet Explorer version 9. An error arises when attempting to fetch media data.

It is possible that your Flash content is attempting to breach a security barrier of some sort. If this is indeed the case, reloading it from a different source may not resolve the issue. I recommend delving deeper into the error messages received by your handler.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Internet Explorer 11 displays a white X instead of the image

While developing a Single Page Application on Angular 1.5, I encountered a frustrating bug in IE11. Instead of rendering my pictures correctly, I see a white X in a black box. Strangely, the browser is receiving a 200 code response for the image request. C ...

Set up a local storage system to store the background color for my page

I have a unique feature on my website where clicking a button generates a random background color each time. However, I am looking to enhance this by implementing a localstorage function that will remember the last clicked color even after closing or reloa ...

Passing PHP array to JavaScript and selecting random images from the array

Check out my PHP script below: <?php $all_images = glob("Images/Classes/{*.png, *.PNG}", GLOB_BRACE); echo json_encode($all_images); shuffle($all_images); ?> Here's the JavaScript code I'm using: functio ...

Tips for getting Vue's element-ui validateField() function to function correctly in conjunction with v-if?

Kindly observe the password fields. The fields for 'Password' and 'Confirm Password' are displayed upon clicking on the 'Change Password?' button. The provided code functions properly and effectively validates the form using ...

Invalid content detected in React child element - specifically, a [object Promise] was found. This issue has been identified in next js

Why am I encountering an error when I convert my page into an async function? Everything runs smoothly when it's not an async function. The only change is that it returns a pending object, which is not the desired outcome. This is how data is being f ...

listbox fails to populate in Internet Explorer but functions correctly in Firefox and Chrome

Hey there! I’m currently working with PHP and JavaScript on a code snippet that allows an admin to select a name from a dropdown menu, which then displays the locations associated with that name. These names belong to sales guys. The functionality works ...

The x-axis scale in d3 is malfunctioning

I'm categorizing data into groups such as rich, poor, and all. I'm using a dropdown to select these values to be displayed on a scatterplot. The first transition works correctly, with text labels appearing as expected. However, upon selecting ano ...

Improving DOM rendering speed in Internet Explorer 11 with Angular 2

Looking for tips on how to boost performance for an Angular 2 app specifically on Internet Explorer 11? Our website runs smoothly on Chrome and Firefox, but experiences slow DOM rendering on IE 11. While I know the browser engine plays a part in this slug ...

Designing a personalized look for a property with Styled-System

Styled-System offers various props related to css grid: I have a suggestion for a new prop, gridWrap. My idea is to allow users to adjust the auto-fit value using the gridWrap prop. Here's the base CSS code: grid-template-columns: repeat(auto-fit, mi ...

User must wait for 10 seconds before closing a JavaScript alert

Can a JavaScript alert be set to stay open for a certain amount of time, preventing the user from closing it immediately? I would like to trigger an alert that remains on screen for a set number of seconds before the user can dismiss it. ...

How do I specify a unique directory for pages in Next.js that is not within the src or root folders?

I'm currently facing an issue when trying to set a custom directory in Next JS. Although the default setup dictates that the pages directory should be located at the root or within the src directory, this arrangement doesn't fit my requirements ...

How do I retrieve and display all the locally stored variables in Angular 2/JavaScript and calculate the total number of keys present in the localStorage?

Currently, I'm developing a project in Angular2 that involves the storage of user-added items to a shopping cart. To accomplish this, I have opted to utilize local storage to temporarily save the items. Each category (such as shoes, clothes, etc.) is ...

What is the best way to create a flexible canvas/grid/row/column that can adapt to changes in browser width and height, all while maintaining its aspect ratio

As someone new to the world of JavaScript, CSS, and HTML, I am eager to learn how to create a game site with multiple games. However, I am feeling lost when it comes to determining the right direction to take. My goal is to develop a game board that can ad ...

Loading content dynamically with AJAX and enabling smooth page scrolling

Looking for a solution to this issue. I have a button on my webpage that, when clicked, uses AJAX to load content into a "div" element below the button. Everything functions properly except for one problem - every time the button is pressed, the page scrol ...

When adding values, they remain in their original positions

I am populating a select dropdown with options using AJAX. These options are added based on the selection made in another dropdown. The first function that appends the data: var appendto_c = function(appendto, value, curcode) { appendto.append("& ...

My Angular JS http.get request is failing to reach the specified URL

While working with AngularJS to integrate RESTful web services into my website, I am encountering an issue where I am consistently receiving errors instead of successful responses. I have been stuck on this for the past three days and any assistance would ...

when a menu bar item is clicked, all items will display the same background color

When visiting my website, I want the selected menu tab to be highlighted in the color #1B3E70. The problem is: Currently, every menu bar item that is clicked on is changing to the background color #1B3E70, instead of just the one selected item. This shou ...

Setting an ID attribute with EditorFor

I have been working with a template for Views and utilizing a lot of JQuery to extract input from an EditorFor. Due to this, I prefer sticking with my current setup using EditorFor instead of something like <input type="text"> I recently added a dat ...

The variable is currently undefined because it has an array assigned to it

Upon selecting multiple checkboxes for variants, I am retrieving checked data using the following method: get selectedIdsFromViolCategoriesFormArray(): string[] { return this.violCategories .filter((cat, catIdx) => this.violCategoriesFormArr. ...

In PHP, you can set properties for objects and arrays, but they will only be created

After exhausting all the solutions I have come across, I am still facing an issue. facebookResponse Object ( [__construct:facebookResponse:private] => [__resp] => stdClass Object ( [data] => stdClass Object ...