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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T12:07:36+00:00 2026-06-18T12:07:36+00:00

I have followed the tutorial found Here to get the basic understanding of what

  • 0

I have followed the tutorial found Here to get the basic understanding of what the title says. So far, I have come to the conclusion that the $.getJSON simply isnt working.

I have withered my code down to this:

<script type="text/javascript">
        $(document).ready(function () {

            var usernameUnavailableRow = $('#usernameUnavailableRow');
            var availabilityMessage = $('#availabilityMessage');

            $("#UserName").hover(function () {
                //usernameUnavailableRow.hide();
            });

            $("#UserName").blur(function () {
            $.getJSON('/OCDB/UsernameAvailable.aspx?' + escape($(this).val()), function (results) {
                if (results.available) {
                    alert("available"); //Just checking if anything even returns
                } else {
                    alert("not available"); //Just checking if anything even returns
                }
            });
        });
        });
    </script>

<table>
         <tr>
            <td>
               <input id="UserName"></input>
            </td>
         </tr>
         <tr id="usernameUnavailableRow">
            <td>
               <span id="availabilityMessage">k</span>
            </td>
         </tr>
</table>

And my UsernameAvailable.aspx page shows exactly this:
{ "available" : "false"}
While Using
<%@ Page Language="C#" CodeFile="UsernameAvailable.aspx.cs" Inherits="UsernameAvailable" ContentType="application/json" %>

Yet nothing is happening in the getJson event.

Can anyone please tell me where I am going wrong, as I am unable to see my mistake.

EDIT
Upon changing the code to remove the 404 error the Javascript produced (Thanks @Archer), the result now always returns True. I have checked to see the page was returning False on a taken username, and it works.

  • 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-18T12:07:36+00:00Added an answer on June 18, 2026 at 12:07 pm

    You overlooked this line on that link:

    The UsernameAvailable.aspx page expects the desired username to be
    supplied in the querystring, like so:
    UsernameAvailable.aspx?desiredUsername.

    You need to do this:

    $.getJSON('UsernameAvailable.aspx?' + escape($(this).val()), function (results){
        if (results.available) {
            // available
        }
        else{
            // unavailable
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have followed this tutorial which allowed me to create a Silverlight DataGrid that
I have followed this tutorial here as mentioned exactly I now try to run
I have a JSF/RichFaces setup, and I found this tutorial . I followed it
I need to scroll over 200 images. I ahve found a tutorial that says
I have followed a tutorial on how to use the youtube gdata. Populating a
I have followed the tutorial for getting a Thunderbird extention going and succeeded in
Hi have followed this tutorial using Core plot framework http://www.switchonthecode.com/tutorials/using-core-plot-in-an-iphone-application My project compiles, but
I have followed the tutorial on the Haskell wiki about i mplementing an IRC
I have followed his popular tutorial to connect Android to MySQL: http://www.helloandroid.com/tutorials/connecting-mysql-database It is
I've followed the tutorial for spring remoting, in particular HttpInvokerServiceExporter and have no problems

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.