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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T12:57:01+00:00 2026-06-14T12:57:01+00:00

I am scratching my head over a problem that I am having with one

  • 0

I am scratching my head over a problem that I am having with one of my JavaScript functions.

I have the following code:

 function getdetails(id) 
{
$('#details').load('load.php?id='+id);
}

The issue with this is, the id often starts with a leading zero or a series of leading zero’s, which means they get cut off. I understand that it’s treating it as an octet which is fine.

So I try to add the following

function getdetails(id) 
{
var id = parseInt(id,10);
$('#details').load('load.php?id='+id);
}

This however still cuts off the zero’s. I have seen some of the padding functions that people have suggested, but for one I can not predict how many zero’s there will and as far as I can tell, the zero’s get removed as soon as it gets passed through as an argument.

Any suggestion on how I can solve this problem?

  • 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-14T12:57:02+00:00Added an answer on June 14, 2026 at 12:57 pm

    Your code is fine – it’s the calling code that needs to be changed. Rather than calling your method with an integer parameter:

    getdetails(0011);
    

    Consumers should call the method with a string parameter:

    getdetails('0011');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am scratching my head over this, but have no idea what the problem
Another jQuery thing for you that I'm scratching my head over. I have some
I have been scratching my head over an encoding problem with a Tomcat web
I'm scratching my head over this one. Below is a running sample. I have
Been scratching my head for a day over this one. I have a few
I've been scratching my head over this for an hour... I have a list
i've been scratching my head these last few days on that problem so i
I have been scratching my head for a while on this one. I dont
I'm really scratching my head on this one: I have an object (MyObject) which
I have been scratching my head over this. I have two data frames: df

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.