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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T06:42:56+00:00 2026-06-13T06:42:56+00:00

I want to do a fire-and-forget jQuery call to a web service. Basically, I

  • 0

I want to do a fire-and-forget jQuery call to a web service.

Basically, I want to send a JSON object to http://myservice.com/uservisits/create and I don’t care to receive any kind of return response. However, we want to use the same service for several of our domains, which means coming up against the cross-domain restrictions tied to Ajax.

How do you do this? There’s a lot out there on JSONP and such, but I don’t need to handle a response. I feel like I’m missing an obvious detail.

  • 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-13T06:42:57+00:00Added an answer on June 13, 2026 at 6:42 am

    The easiest way to send an http GET request is with an image beacon:

    var json = encodeURIComponent(JSON.stringify(obj));
    new Image().src = "http://myservice.com/uservisits/create?JSON=" + json;
    

    And, you can even get a little bit of information back by handling the load and error events. Of course, if the response is not an image, the error event will be called, and not load. You can set your service to return a single pixel image to solve that.

    Edit: You mentioned you may prefer to use an HTTP POST. It’s not nearly as simple as an image beacon, but you can make a cross-domain post using a hidden iframe:

    var frame = $("<iframe>").hide();
    frame.load(function() {
        var frameBody = frame.contents().find("body");
        var form = $("<form>", {
            action: "http://myservice.com/uservisits/create",
            method: "POST"
        });
        form.appendTo(frameBody);
        $("<input/>", {
            name: "json",
            value: json
        }).appendTo(form);
        form[0].submit();
    });
    frame.appendTo("body");
    

    I think jQuery has something like this built in already. You might try digging through the jQuery.ajax documentation. If not, you could probably find a plugin that does it.

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

Sidebar

Related Questions

I just want to fire an event when an input changes value using jQuery
After a user cancels a delete confirmation I want to fire a javascript call
I have ul li list and I want to fire a jQuery click event
I am using ExtJs virtual keyboard Ref: http://efattal.fr/extjs-dev/examples/virtualkeyboard I want to fire an ajax
I have a custom event that I want to fire using jQuery's trigger method:
I want to fire an event after loading all images. And also, I want
i want to fire an event manually using c#. For instance, say if i
Onsubmit I want to fire fancybox popup I need only to show the fancybox
I have a periodically_call_remote that I want to fire right away (as if the
I have several sql queries that I simply want to fire at the database.

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.