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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T18:37:01+00:00 2026-06-09T18:37:01+00:00

So I am trying to do a post using jQuery.ajax instead of an html

  • 0

So I am trying to do a post using jQuery.ajax instead of an html form. Here is my code:

$.ajax({

type: 'POST', // GET is available if we prefer
url: '/groups/dissolve/$org_ID',
data: data,
success: function(data){
    $('#data_box').html(data);
    }
});

Here is my problem:

When this was in an html form, the $org_ID that was part of the URL would actually pull the variable and send it as part of the URL. Now that this is in jquery, its just sending $org_ID as text. How can I get this to figure out what the variable, $org_ID is? I tried declaring it in the javascript but I am brand new to jquery/javascript and don’t really know what i’m doing.

Thanks!

  • 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-09T18:37:02+00:00Added an answer on June 9, 2026 at 6:37 pm

    Are you rendering this in PHP? In that case you need to do:

    url: '/groups/dissolve/<?php print $org_ID; ?>'
    

    Otherwise, you need to do something like

    var org_id = 'foo'; 
    // or
    var org_id = '<?php print $org_id ?>';
    $.ajax({
    
    type: 'POST', // GET is available if we prefer
    url: '/groups/dissolve/'+org_ID,
    data: data,
    success: function(data){
        $('#data_box').html(data);
        }
    });
    

    Unlike PHP, you can’t interpolate variables in javascript, you have to concatenate them with the string.

    If you’re trying to POST a variable (org_id) then you should put it in data:

    data['org_id'] = org_id;
    
    $.ajax({
    
    type: 'POST', // GET is available if we prefer
    url: '/groups/dissolve/',
    data: data,
    success: function(data){
        $('#data_box').html(data);
        }
    });
    

    While you can concatenate params onto your url to send them in an HTTP request, putting them in a data object not only lets jQuery do more work for you & escape HTML entities etc (and keep your code cleaner), but also allows you to easily debug and play around with ajax() settings.

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

Sidebar

Related Questions

I'm trying to submit a form through AJAX instead of using the normal POST
I am trying to post a multi-part form using httplib, url is hosted on
I am trying to post a URL to the server using the Asynchronous type
I have a login form using jquery ajax and a php code. The issue
I am trying to perform a simple jQuery AJAX attempt using either a .get()
Im having trouble trying to post data correctly using jQuery/AJAX I have the following...
I'm trying to get a textbox value which contains > symbol using jQuery ajax
I am trying to get the value of the posted textbox using jquery AJAX:
I am using jquery ajax api to submit (POST/GET) a text as parameter to
I'm using the following code in my HTML form - trying to make a

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.