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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T08:57:45+00:00 2026-06-11T08:57:45+00:00

I have an AJAX request in function in another file. I need to pass

  • 0

I have an AJAX request in function in another file. I need to pass json parameters to this request. Here are sample params which work in my ajax:

{firstName : name, lastName: sname, email : email, password : pass},

I would like to pass data as a function’s parameter. I tried to pass it as a string param, but my function recognise it, and sends as a string. Which does not work.

My function with ajax request:

function ajax(url,contentType,data)
{  
    $.ajaxSetup ({
    cache: false
});

console.log("Starting AJAX");

$.ajax({                                                                   
    crossDomain: true,
    type: 'GET',
    url: url, 
    callback: 'jsonpCallback',
    jsonpCallback: 'jsonpCallback',
    jsonp: '_jsonp',
    data: data, 
    scriptCharset: "utf-8",
    contentType: contentType,
    dataType: 'jsonp json',
    timeout : 5000,

    success: success,
    error: error,
});
console.log('AJAX done');
}

I tried this:

ajaxRegister('http://lalal/register','application/json',data);

ajaxRegister('http://lalal/register','application/json','{firstName : name, lastName: sname, email : email, password : pass}');

The point is that when I put this sample json as a data parameter of the request, it works. I want to be flexible and be able to put any json in parameter and send it as a request’s param.

  • 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-11T08:57:46+00:00Added an answer on June 11, 2026 at 8:57 am

    The answer is passing parameters in ” “. It helped, but was not necesserly when locally adding data.

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

Sidebar

Related Questions

I have a php function which returns JSON in response to a ajax request
Ok, normally I have an ajax request wrapper function where I pass the $data
I have a jquery function for sending email with ajax request; function sendMail(from,to,subject,message){ var
I have a very simple ajax request: $.get(url, data) .done(function () { }) .fail(function
So I have this javascript function, it sends an ajax requests to fetch a
I have a seperate .js file and namespace for json requests. I have another
I have an AJAX function triggerd by a click which basically copies one table
Ok here is my problem. I have a file which outputs an XML based
I have a function which loads up relevant js functions on click using ajax's
i send ajax requests with jquery, and i have a function: $('input').ajaxSuccess(function(e, xhr, settings)

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.