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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T16:46:37+00:00 2026-06-05T16:46:37+00:00

I have a problem related to an array data which fetched from an external

  • 0

I have a problem related to an array data which fetched from an external file. The script used is AJAX ina .js file. After fetching the data from an external file (.php), the array data showed a comma in front of each item. Is there any problem with my code? If there is any way to solve this problem, please do let me know.

Sample code:

var i = 1;
var loadPcs = [];
var deststop = [];
var datestop = [];

while (i <= counter)
{
                    
    deststop[i]= encodeURI(document.getElementById('stop'+i).value);
    deststop[i] = deststop[i] + ("%");
    
    datestop[i]= encodeURI(document.getElementById('depDate'+i).value);
    datestop[i] = datestop[i] + ("%");

    notes[i]= encodeURI(document.getElementById('notes'+i).value);
    notes[i] = notes[i] + ("%");

    i = i + 1;  
}

    {

    var stopdest = deststop;
    var stopdate = datestop;

        http.open('get', 'insert.php?&deststop='+stopdest+'&datestop='+stopdate+'&loadPcs='+loadPcs+'&notes='+notes+'&counter='+counter);  
    }
  • 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-05T16:46:41+00:00Added an answer on June 5, 2026 at 4:46 pm

    Try this:
    Instead of using array take a string variable , take a look at below code

    var deststop = "";
    while(i <= counter)
    {
       deststop += encodeURI(document.getElementById('stop'+i).value) + "%" ;
    } 
    

    Replace all arrays with a string variable and append data like done in above code.

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

Sidebar

Related Questions

hello I am having problem related to https:// . I have used FB.getLoginStatus(function(response) function
I have customized uitableViewcell in which each cell show four data which are related
I have a UITableView which loads data from XML using the below code. It
I have a problem with automagic and related model data. I have 4 models:
I have a problem when submitting a from with a related entity. I get
I'm using EJB3 and I have a problem related to refreshing my EntityManager .
I have a performance problem related to string comparison (in Java). I'm working on
I have problem with my widget related to performance and memory: Issue : My
This is a problem is related to worker role hosted VM. I have a
I have seen some related questions but none focusing on the specific problem I

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.