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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T21:01:00+00:00 2026-05-12T21:01:00+00:00

I was told that $.getJSON is the best way to send data to and

  • 0

I was told that $.getJSON is the best way to send data to and from external servers. I probably wasted 7 hours of my time trying to use JQUERY’s Ajax to do so just to find out that no browsers allow that type of method. I would like to send the data using the Jquery getJSON and I am using cakephp as my receiving end (i.e. My external server) Here is what i have so far.

$.getJSON("http://play.mysite.com/usersessions/store/",{ data: "Hi!"});

I don’t want a callback because I dont need it. I just need to send some data to the external server. This is MVC site so usersessions is my controller, store is my action.

Below is my cakephp code. If you don’t know it then that is fine. I just really need to know if I am sending the getJSON data correctly

<?php class UsersessionsController extends AppController {

var $name = 'Usersessions';
var $helpers = array('Html', 'Form','Ajax');
var $components = array('RequestHandler');


function store()
{
   Configure::write('debug', 0);
   $this->autoRender = false;

   if($this->RequestHandler->isAjax()) {
       if ($this->params['url']['data'])
       {
           $this->data['Usersession']['data'] = $this->params['url']['data'];
            $this->Usersession->Save($this->data);
            echo 'Success';
        }   
   }    
}

}
?>

Thanks you!

  • 1 1 Answer
  • 3 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-12T21:01:00+00:00Added an answer on May 12, 2026 at 9:01 pm

    getJSON() is for reading JSON data from the server. If you just want to send some parameters from the browser to the server, just use get() and don’t use the optional callback.

    From the docs:

    Request the test.php page and send some additional data along (while still ignoring the return results).

     $.get("test.php", { name: "John", time: "2pm" } );
    

    http://docs.jquery.com/Ajax/jQuery.get#urldatacallbacktype

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

Sidebar

Related Questions

I've been told that the best way to learn a programming language is to
I was told that the optimal way to program in C++ is to use
I've been told that every COM method callable from C++ code (take for instance
I was told that the assembly files made from C# and F# source is
I've been told that swap mem should never be used for the best shape
I have been told that the Provider pattern is a way to design loosely
I have been told that a great way to decrease the load on my
I'm told that the template system in C++ is Turing-complete at compile time. This
i was told that to redirect from standard input to file i need to
I was told that for some reason, you can't update a database schema when

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.