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 3873376
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T22:01:46+00:00 2026-05-19T22:01:46+00:00

I have this file uploader inside an iframe, but when I embed it to

  • 0

I have this file uploader inside an iframe, but when I embed it to another website it doesn’t allow me, Firebug displays this error:

Permission denied for <http://www.mywebsite.com> to get property Window.document from <http://www.myotherwebsite.com>.

Which comes to this line:

$('iframe', top.document).css('border', '1px green solid'); 

I’m trying to style the iframe with a border once the upload has completed.

I saw other questions, the solution is to make a server-side proxy and I don’t know how to make a proxy for it to work and allow the jQuery the execute.

Cheers.

Bounty added.

  • 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-05-19T22:01:46+00:00Added an answer on May 19, 2026 at 10:01 pm

    A server-side proxy may help you overcome this problem. While a browser can only make an AJAX call to it’s server using the same domain, a server itself can make a call to any other server without restriction.

    Let’s say you need to make an AJAX request to Yahoo’s Weather API. Since you cannot make a request from http://www.example.com to http://www.yahoo.com because of the same domain policy, the workaround is to make a call first to your server, and then have your server make the request to Yahoo. Below is an example of a proxy that does just that:

    REQUEST: http://www.example.com/weather.php?zip=97015

    <? // Yahoo Weather proxy
    
    $zip_code = $_REQUEST["zip"];
    
    // default to Portland, OR for testing
    if($zip_code == null || $zip_code == '')
        $zip_code = "97206";
    
    // delegate request to the other server, circumventing the same-domain policy.
    $request = "http://weather.yahooapis.com/forecastrss?p=".$zip_code;
    
    $response = file_get_contents($request);
    
    // Retrieve HTTP status code
    list($version,$status_code,$msg) = explode(' ',$http_response_header[0], 3);
    
    
    // Check the HTTP Status code
    switch($status_code) {
        case 200:
                // Success
                break;
        case 503:
                die('Your call to Yahoo Web Services failed and returned an HTTP status of 503. That means: Service unavailable. An internal problem prevented us from returning data to you.');
                break;
        case 403:
                die('Your call to Yahoo Web Services failed and returned an HTTP status of 403. That means: Forbidden. You do not have permission to access this resource, or are over your rate limit.');
                break;
        case 400:
                // You may want to fall through here and read the specific XML error
                die('Your call to Yahoo Web Services failed and returned an HTTP status of 400. That means:  Bad request. The parameters passed to the service did not match as expected. The exact error is returned in the XML response.');
                break;
        default:
                die('Your call to Yahoo Web Services returned an unexpected HTTP status of:' . $status_code);
    }
    
    
    echo $response;
    ?>
    

    Now, in your case, you want to style the iframe when the file is done uploading. A simple solution would be to poll the parent document’s server and have the proxy poll your upload server until the file is found. Once the file is found, the response can be used to invoke the JQuery code that changes the iframe styling.

    In order for the proxy concept to work, each website that you embed the uploader into will need to have it’s own same-domain proxy deployed that will check your upload site for the existence of the file and then return that response back to the client.

    The parent document will also somehow need to know the name of the file being uploaded. Because of the same domain policy, you may not be able to determine the filename, which presents a challenge when using the proxy to check for the existence of the file. How do you know what you’re checking for?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I have this GIF file on my desktop (it's a 52 card deck
So I have this .htaccess file in the /blog/ folder on my webserver and
I have this tiny Qt project with a project file like this: TEMPLATE =
Say I have this given XML file: <root> <node>x</node> <node>y</node> <node>a</node> </root> And I
This is driving me crazy. I have this one php file on a test
I have this function to read in all ints from the file. The problem
I have some code that effectively does this : File file = new File(C:\\Program
I have this on line 56 in my environment.rb: I18n.load_path += Dir[ File.join(RAILS_ROOT, 'lib',
I have a generated txt file. This file has certain lines that are superfluous,
I have this: Dim myTemp As String myTemp = System.DateTime.Now().ToString(MMMddyyyy_HHmmss) & .pdf System.IO.File.Copy(myFile, c:\

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.