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

  • SEARCH
  • Home
  • 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 1088215
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T23:02:37+00:00 2026-05-16T23:02:37+00:00

Here’s the goal: Hand off a script tag that references a JavaScript file on

  • 0

Here’s the goal:

Hand off a script tag that references a JavaScript file on a remote server. That JavaScript file should return HTML that will then be displayed on the calling HTML page.

I’ve attempted to approach this in two ways:

First, I attempted to use XMLHttpRequest in JavaScript to call this remote server. In IE, it would work as expected but FF, Safari, and Chrome would return an empty response. The overall response I got from my research was that the request was being blocked since the server it’s trying to access is different from where it’s running (both localhost, but different ports).

Second, I looked at how things like Google Gadgets work as they effectively give you a simple script tag that’s referencing external JavaScript. From what I can gather, it appears that there’s some sort of iframe action going on simply by the base url being used (example below). This appears to be the way to go, even though using an iframe wasn’t my initial thought. I’m guessing the Google code is returning an iframe as HTML to the HTML file that has this script embedded.

Any suggestion on how I should proceed?

<script src="http://www.gmodules.com/ig/ifr?url=http://ralph.feedback.googlepages.com/googlecalendarviewer.xml&amp;synd=open&amp;w=320&amp;h=200&amp;title=&amp;border=%23ffffff%7C3px%2C1px+solid+%23999999&amp;output=js"></script>
  • 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-16T23:02:37+00:00Added an answer on May 16, 2026 at 11:02 pm

    JSONP is a very common way to deal with same origin policy. Since most javascript frameworks (e.g., jquery) already support it, you don’t have to get into technical details to use it.
    You can also do the trick yourself by constructing script tag from javascript (as you mentioned). Google Analytics code snippet is an example of such approach:

          var ga = document.createElement('script');
          ga.type = 'text/javascript';
          ga.async = true;
          ga.src = 'url here';
          var s = document.getElementsByTagName('script')[0];
          s.parentNode.insertBefore(ga, s);
    

    As for iframe idea (if I understand you currectly), it’s not gonna work. You can use iframe element on your page to display content from another server, but browser won’t let you access it from main page using javascript.

    edit
    This original proposal details JSONP usage:
    http://bob.pythonmac.org/archives/2005/12/05/remote-json-jsonp/

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

Sidebar

Related Questions

Here's a basic regex technique that I've never managed to remember. Let's say I'm
Here is the issue I am having: I have a large query that needs
Here's my scenario - I have an SSIS job that depends on another prior
Here's a coding problem for those that like this kind of thing. Let's see
Here is the scenario: I'm writing an app that will watch for any changes
Here's an interesting problem. On a recently installed Server 2008 64bit I opened IE
Here's a problem I ran into recently. I have attributes strings of the form
Here is a simplification of my database: Table: Property Fields: ID, Address Table: Quote
Here is my code, which takes two version identifiers in the form 1, 5,
Here we go again, the old argument still arises... Would we better have a

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.