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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T07:36:50+00:00 2026-06-16T07:36:50+00:00

In index.html under body tag: <a href=javascript:setTempInc()>+</a> <a href=javascript:setMode(0)>-</a> and under <head><script type=text/javascript>: var

  • 0

In index.html under body tag:

<a href="javascript:setTempInc()">+</a> <a href="javascript:setMode(0)">-</a>

and under <head><script type="text/javascript">:

var url = "get.php";

function ajaxRequest()
{
    var xmlhttp = new XMLHttpRequest();

    xmlhttp.onreadystatechange = function()
    {
        if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
        {
            var jsondata = eval("(" + xmlhttp.responseText + ")"); //retrieve result as an JavaScript object

            document.getElementById("y").innerHTML = jsondata.y;

        }
    }

    xmlhttp.open("GET", url, true);
    xmlhttp.send();
}

function setTempInc()
{
    var oldUrl = url;
    url = url + "9001" + jsondata.y;
    ajaxRequest();
    url = oldUrl;
}

I don’t understand where the problem is. url is a string and jsondata.y is a int but the script doesn’t work!

This function does, though:

function setMode(val)
{
    var oldUrl = url;
    url = url + "91" + val + "000";
    ajaxRequest();
    url = oldUrl;
}
  • 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-16T07:36:51+00:00Added an answer on June 16, 2026 at 7:36 am

    I would think that

    var jsondata = eval("(" + xmlhttp.responseText + ")"); 
    

    is not available to be called at

    url = url + "9001" + jsondata.y;
    

    as it is only defined inside the ajaxRequest function’s scope.

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

Sidebar

Related Questions

My result: https://i.stack.imgur.com/pTMUw.png My style.css body { background: url(img/bgs.png) repeat #cccccc; color: #000000; }
I wonder if the index.html MUST be in the www folder on the server
I am working to fetch data which is under iframe tag.I want the data
I'm struggling to under the behaviour of the following html and css code. I'm
I'm writing a game in javascript, and I want my character to mave under
The following, in Firefox 3.6, simulates a modal overlay: <html> <body> <div id=modal style=position:
I'm working on a webpage located at http://www.richmindonline.com/doggy/index.html . I'm having trouble styling a
I have the following structure in html5: html - body - header - #wrapper
I want to position a dropdown menu exactly under the button. Here's my code,
I am evaluating CasperJS' testing API under Windows. Unfortunately, the test property of the

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.