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

  • Home
  • SEARCH
  • 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 6215053
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T06:59:09+00:00 2026-05-24T06:59:09+00:00

I am trying to get a URL variable into a jQuery ajax function, in

  • 0

I am trying to get a URL variable into a jQuery ajax function, in order to quickly adapt some code.

This should be simple, but i’m a bit of an idiot and using the methods described at http://jquery-howto.blogspot.com/2009/09/get-url-parameters-values-with-jquery.html didn’t work out for me.

Essentially I am trying to replace the hard-coded “player_tsid” with a variable on the end of a url, like http://www.example.com/?player_tsid=PIF575TP7IOBA

Here is the code ..

$(function(){

jQuery.support.cors = true;

$.ajax({
    'url' : 'http://api.glitch.com/simple/players.getAnimations',
    'dataType' : 'json',
    'data' : { 'player_tsid' : 'PIF1UFTOS10HF' },
    'success' : function(data, textStatus, jqXHR){
        if (data.ok){
            g_sheets = data.sheets;
            g_anims = data.anims;
            build_index();
            $('#loading').text("Loading sheets...");
            load_sheets();
        }else{
            alert('api error');
        }
    },
    'error' : function(jqXHR, textStatus, errorThrown){
        alert('api error');
        alert(errorThrown);
    }
});
});

,,

  • 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-05-24T06:59:10+00:00Added an answer on May 24, 2026 at 6:59 am

    Just do this

    var tsid = 'PIF1UFTOS10HF';
    $.ajax({
        'url' : 'http://api.glitch.com/simple/players.getAnimations?player_tsid='+tsid,
        'dataType' : 'json',
        'success' : function(data, textStatus, jqXHR){
            if (data.ok){
                g_sheets = data.sheets;
                g_anims = data.anims;
                build_index();
                $('#loading').text("Loading sheets...");
                load_sheets();
            }else{
                alert('api error');
            }
        },
        'error' : function(jqXHR, textStatus, errorThrown){
            alert('api error');
            alert(errorThrown);
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

ok so im trying to get a javascript variable into a php script, this
I'm trying to get the following code working: string url = String.Format(@SOMEURL); string user
I am trying to rewrite an url with GET-data from a form. This works
I am trying to use Jquery's .get function (below) to return a simple text
I am trying to transfer a variable from the URL into a contact form
I am trying to dynamically get a php variable and place them into my
I am working on my website, and I am trying to get the url
I'm trying to get a custom handler to work for a specific URL (or
I'm trying to get php to automatically pass the session ID via url, even
I'm trying to get the query string from a string (not the current URL).

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.