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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T11:08:12+00:00 2026-06-01T11:08:12+00:00

In Firebug (with the FirePHP plugin) I noticed that there is no communication with

  • 0

In Firebug (with the FirePHP plugin) I noticed that there is no communication with the PHP file, and hence nothing happens…

Here is the Javascript:

// three parameters are required by Dojo!
function buildMenu(type, data, evt)
{
    var menuDOM = document.getElementById("colorselect");
    var nextColor, nextItem;

    // delete previous items in the color menu
    menuDOM.options.length = null;

    // split the data into an array of colors
    var colors = data.split(', ');

    // go through the returned array of colors
    for(var i = 0; i < colors.length; index++)
    {
        nextColor = colors[i];
        nextItem = new Option(nextColor);

        /* add the new item to the menu
         ("null" for IE5, "-1" for all other browsers) */
        try
        {
            menuDOM.add(nextItem, -1);
        }
        catch(e)
        {
            menuDOM.add(nextItem, null);
        }
    }
} // end of function buildMenu

// the function that calls bind to request data
function getColors(size)
{
    dojo.io.bind( {url: "shirtColors.php" + "?size=" + size,
                    load: buildMenu,
                    method: "GET",
                    mimetype: "text/plain"
                    } );
}<br /><br />

Here is the PHP:

<?php

    $shirtSize = $_GET["size"];

    // array for available colors (for each shirt size)
    $colors = array("large" => "black, yellow, green",
                    "medium" => "blue, purple, white, off-white, cream, bleached-white",
                    "small" => "orange, red, aqua, turqoise, aquamarine, light-blue");

    echo $colors[$shirtSize];
?><br /><br />

…and here is the html:
(Dojo is linked to online here, and the Dojo io library is imported)

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>Shirt Colors</title>

        <!-- link to dojo online -->
       <script src="//ajax.googleapis.com/ajax/libs/dojo/1.7.2/dojo/dojo.js"></script>

       <!-- javascript file -->
       <script type = "text/javascript" src = "shirtColors.js"></script>

       <!-- import the dojo io library -->
       <script type = "text/javascript">
        dojo.require("dojo.io.*");
       </script>

    </head>
    <body>

       <select onchange = "getColors(this.value);">
            <option value = "large">
                large shirt
            </option>
            <option value = "medium">
                medium shirt
            </option>
            <option value = "small">
                small shirt
            </option>
       </select>

       <select id = "colorselect"></select>

    </body>
</html>
  • 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-01T11:08:13+00:00Added an answer on June 1, 2026 at 11:08 am

    dojo.io.bind is a very old function.

    The new and supported way for your use-case is to use dojo.xhrGet or dojo.xhrPost

    var deferred = dojo.xhrGet(
     {
        url: "shirtColors.php",
        content: {
          'size': size
        },
        handleAs: "text",
        load: buildMenu,
        error: function(error){
          //error handling code
        }
      }
    
    
    );
    

    Note that query params are passed as ‘content’.

    Modify your buildMenu function:

    function buildMenu (data)
    {
    //data contains the text string for the data returned by PHP
    }
    

    See http://dojotoolkit.org/reference-guide/1.7/dojo/xhrGet.html for more details

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

Sidebar

Related Questions

With firebug I found that clicking on the link calls javascript function <a href=#
Using Firebug I have found that the Dynatree plugin changes the following code: <li
I saw that FireBug can track CSS changes with its plugin FireDiff, but I
Firebug is such a spectacular development tool for javascript, is there any kind of
I don't get FirePhp FirePhp is an extension for the Firefox add-on Firebug. I
firebug is quite useful tool that I can't think myself living without it. I
Firebug is certainly a wonderful tool for javascript debugging; I use console.log() extensively. I
I created a index.php file located in http://localhost/home/index.php . The file filled with the
Firebug claims that an unstyled textbox is border: 3px inset #F0F0F0; However, <input type=textbox
According to Firebug console, we have the following in JavaScript: >>> [''] == ''

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.