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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T03:59:52+00:00 2026-06-16T03:59:52+00:00

I have a JS script that is hosted on domain X, but is embedded

  • 0

I have a JS script that is hosted on domain X, but is embedded on domain Y. I would like to send some data back to a page on domain X (via POST probably).

I tried searching for a solution, but most information I found involves using jQuery. Is it possible to do this via plain JavaScript? Should I be worried about cross-site scripting issues?

Basically, I am trying to have something similar to Google Analytics (a little widget sending data back home). I can process the data, but my JavaScript experience is very limited.

  • 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-16T03:59:54+00:00Added an answer on June 16, 2026 at 3:59 am

    The simplest way to submit data is to use a form. You can create a form, set action, method attribute, add inputs with data, set it value and then do form.submit(). In order to don’t redirect user to your site you should also fill a target attribute with name of a hidden iframe. In that case form will be sumbitted “in it”. Page woun’t reload, but your page will be loaded into iframe (which is hidden). This method allows you to do POST requests.

    If you need only GET request, things are even simplier: create an Image object in JS and set src field with the requested url. I don’t know how crossbrowser and stable this solution is, but as far as I remember, it works. In fact, you can create and add to page any other element that loads it’s content (style, script (and put some codde in response to be evaluated) ).

    About crossdomain stuff:

    • in case of GET requests you can send information and receive it.
    • in case of POST request there is no (as for me) way to get the response.

    I suggest you to read something about DOM manipulations in JavaScript and HTML forms to understand it’s mechanics and what to do in order to simulate form submission in JS (basically I described it in first two paragraphs).

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

Sidebar

Related Questions

I have a script that submits data via an ajax POST. It is called
We have files that are hosted on RapidShare which we would like to serve
I have a script in Filemaker that calls a Brian Dunning hosted custom function
I have a PHP script that parses an array using the json_encode() method but
I have a PHP script hosted on my site that outputs a value based
Ok so I have a bit o' script that works in FF but not
I have a JS script that will be hosted on my server and that
I have script that reads remote file content and writes it to local server.
I have this script that run to fix my menu bar to the browser
I have a script that recursively loops through all the sub directories and compresses

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.