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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T13:10:17+00:00 2026-05-26T13:10:17+00:00

This is annoying me. I’m setting an array in beginning of the doc: var

  • 0

This is annoying me.

I’m setting an array in beginning of the doc:

 var idPartner;

 var myar = new Array();
 myar[0] = "http://example.com/"+idPartner;

And I’m getting a number over the address, which is the id of partner. Great. But I’m trying to set it without success:

 $.address.change(function(event) {
   idPartner = 3;
   alert(idPartner);
 }

Ok. The alert is giving me the right number, but isn’t setting it.

What’s wrong?

  • 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-26T13:10:17+00:00Added an answer on May 26, 2026 at 1:10 pm

    Changing the value of the variable does not re-set the values within the array. That is just something javascript can’t do automatically. You would have to re-generate the array for it to have the new id. Could you add the id to the value where you use the array instead of pre-setting the values in the array containing the id?

    Edit: For example, you would do:

    var myArray = [];
    var myId = 0;
    myArray[0] = "http://foo.com/id/";
    

    and when you need to use a value from the array, you would do this:

    var theVal = myArray[0] + myId;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have this annoying problem with my site where, when you click on a
I am getting this annoying problem, whenever i do some changes to any file
Wondering if anyone can help me with this annoying but trivial (in terms of
This is annoying - I know how I'd do it in web... I have
I am having this most annoying issue when I try to rebuild my solution
I always found this rather annoying fact about applets, that they disappear if you
I've been having this really annoying thing happen the past few days, that has
This has been annoying me for a while in several XCode projects. I really
I find this syntax astoundingly annoying. Every time I rename my class, I have
This happens repeatedly and is very annoying. I upload some PHP code to 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.