Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8210293
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T10:01:27+00:00 2026-06-07T10:01:27+00:00

In my website, I have a form which allows users to post an image

  • 0

In my website, I have a form which allows users to post an image or a video to Facebook. Because I need to post the files directly to Facebook, I’m using a form that is posting to an Iframe (To prevent redirected the user to the Facebook post url, after the post is sent).

While the post is being sent (Its important to note that the post is sent to a Facebook domain and not my own domain), I present the user a waiting message, and when the post is finished, I use the iframe onload event to hide the message.

Here is the code:

The iframe:

<iframe name="uploader" width=2px height=2px style="visibility: hidden" onLoad="locationChange(this)"></iframe>

The JavaScript for hiding the message, when the iframe is loaded:

function locationChange(ifrm) 
{
    alert("Iframe Change");
    document.getElementById("loadingOff").style.visibility = "hidden";
}

That works on all browsers except IE9. I can see the “Iframe Change” message on IE9 when I first enter the page. But I don’t see it after the post is sent (On Chrome and FireFox I see the message twice, when I enter the page and after the post is sent).

I’ve also tried using this:

<script type='text/javascript'>
 var iframe = document.getElementsByName("uploader");

 alert(iframe.toString());

 iframe.onload = iframe.onreadystatechange = function(){
     if( this.readyState && this.readyState !== "complete" && this.readyState !== "loaded" )
     {
           alert("Not loaded");
     }
    alert("Local iframe is now loaded");
 }         
</script>

and also this:

if (iframe.attachEvent){
    iframe.attachEvent("onload", function(){
        alert("Local iframe is now loaded.");
    });
} else {
    iframe.onload = function(){
        alert("Local iframe is now loaded.");
    };
}

But the last two didn’t work on any of the browsers. How can I attach the onload event to IE9 ?

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T10:01:28+00:00Added an answer on June 7, 2026 at 10:01 am

    getElementsByName returns array of elements.

    so write

    var iframe = document.getElementsByName("uploader")[0];
    

    instead of

    var iframe = document.getElementsByName("uploader");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Currently on my website - I have a form which users use to post
The website has a normal registration form which allows users to register and the
On my website, I have a button which when clicked displays a feedback form
I have a website form that collects url of users to store in a
I have a comment form on my website which, at the moment I filter
I made a website on which i need to be able to upload video
Currently on my website I have a form in which once it is submitted,
Possible Duplicate: Jquery trigger file input I'm working on a form which allows users
I have a client WordPress website that allows users to upload custom artwork from
I have website based on Umbraco 5. I have installed contact form plugin (http://cultivjupitercontact.codeplex.com/).

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.