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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T06:53:18+00:00 2026-06-11T06:53:18+00:00

I have several servers on an intranet. I am passing data from one server

  • 0

I have several servers on an intranet. I am passing data from one server to be processed on another server. Attempting to use ajax but I am a noob.

<script type="text/javascript" src="jquery-1.8.0.js"></script>
<script type="text/javascript">
function print(oForm){

var toggle = oForm.elements["toggle"].value;
var ticket_type_id = oForm.elements["ticket_type_id"].value;
var printer_id = oForm.elements["printer_id"].value;
var store_id = oForm.elements["store_id"].value;
var data = oForm.elements["data"].value;

var dataString = "toggle="+ toggle+ "&ticket_type_id="+ ticket_type_id+ "&printer_id="+ printer_id+ "&store_id="+ store_id+ "&data="+ data;
$.ajax(
{
type:"POST", 
url:"http://192.168.12.103/crowncontrol/backend/processes/print.php", 
data:dataString,
success: function(data){
alert("successful");
}
}
);
}
</script>

The above URL does not work.
But if I make the url:

"../../../backend/processes/print.php"

Which is the same location, it works fine.
Also if I send it via Anchor Get it works fine:

href="http://192.168.12.103/crowncontrol/backend/processes/print.php?etc"

The reason I am using ajax is, I want my print.php script to run with out the user noticing. The reason I can’t use url:”../../../backend/processes/print.php” is because I will be sending information from one server to another servers on my intranet.

Any help would be appreciated. I’ve spent far too long trying to get it to work on my own.

AFTER help from the answers below instead of the entire ajax code I used:

$.getJSON('http://192.168.12.103/crowncontrol/backend/processes/print.php?callback=?',dataString,function(res){
    //alert('Success');
});

also:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js" type="text/javascript">
  • 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-11T06:53:20+00:00Added an answer on June 11, 2026 at 6:53 am

    This is a result of the same origin policy. You can not perform a normal AJAX requests cross-domain requests for security reasons (see the link about same origin policy).

    Fortunately for you jQuery includes JSONP request support which uses script tag injection instead of XMLHttpRequest.

    Instead of creating and using an xhr object (XMLHttpRequest which is how ajax is done) it creates a script tag with an src attribute set to your URL. it should work.

    Try changing your code to :

        $.ajax(
    {
    type:"POST", 
    url:"http://192.168.12.103/crowncontrol/backend/processes/print.php?callback=?", 
    data:dataString,
    success: function(data){
    alert("successful");
    }
    }
    );
    

    (notice the ?callback=? part)

    Here is a jsonp tutorial for jQuery

    Here is some information about jsonp and some information about the same origin policy

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

Sidebar

Related Questions

I have several assemblies for SQL Server 2005. If invalid data is entered to
I have several instances of my project running on my server, like so: http://0.0.0.0/one
I have several servers running the same code but each handling specific messages (they
I have several web-servers and need them to use Quartz. The clustering feature of
(Briefly, like this question but for Windows servers.) I have several Win2003 servers running
I have to create WCF servers farm (several workstations in Intranet environment that host
At work we have several Solaris servers. Each server runs apache which we compiled
I have several functions that I wrote and I use regularly on my servers,
I have some programs that use the Net::Telnet module to connect to several servers.
I have several servers hosted with GoGrid, and every time I reboot one of

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.