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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T21:49:32+00:00 2026-06-01T21:49:32+00:00

The below code works fine in both Chrome and IE $.get(../ajax/BTBookAppointment.aspx?dsl= + telNumberBox.value +

  • 0

The below code works fine in both Chrome and IE

$.get("../ajax/BTBookAppointment.aspx?dsl=" + telNumberBox.value + "&date=" + requiredDate.value + "&timeslot=" + ddTimeslot.value, function (response, status, xhr) {
//DO some stuff
}); 

However in Firefox (Version 11.0) the callback function is never hit. I have used firebug with a breakpoint and have verified the callback is never entered. The page seems to refresh, an element that was previously shown by JavaScript becomes visible again.

I’m at a loss as to what the bug could be or even how to debug it further. Any advice would be appreciated.

EDIT: Fiddler and firebug never show a HTTP get. I have also tried writing out the $.get explicitly (see below) and get the same behaviour

EDIT2: I have tried the suggestions mentioned by Darin Dimitrov and it still exibits the same behavior (the page posts back when the button is clicked). Here is the code as it stands.

Javascript

function bookAppointment() {

    var url = "../ajax/BTBookAppointment.aspx";
    var dsl = "01753893530"
    var date = "20-04-2012";
    var timeslot = "PM";

    var data = { dsl: dsl, date: date, timeslot: timeslot };

    $.ajax({
        url: "../ajax/BTBookAppointment.aspx",
        data: data,
        success: function (response, status, xhr) {
       alert('into callback');
        },

    });

    return false;
}

HTML

<button id="btnBookAppointment" onclick="bookAppointment();"> Book</button>
  • 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-01T21:49:34+00:00Added an answer on June 1, 2026 at 9:49 pm

    I don’t know why but it seems the button was still triggering the default behavior (a postback) in FF even when bookAppointment() returned false. Adding a return false to the button fixed things (see below).

    <button id="btnBookAppointment" onclick="bookAppointment();return false;">
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

HI all, Below mentioned javascript code works fine in all browsers including chrome(from second
My below code works fine and is used to populate a <select> item with
The code below is creating a server to communicate with clients.This code works fine
The code below works fine. But it seem clunky. How would you combine the
the code below works fine but it takes an absolute age to run. How
Currently my code below works fine but it's a bit of overkill. In my
Please i need help, this code below works fine on my localhost, php5.3+ but
I'm trying to open a ZIP file in JAVA. The code below works fine
I have the code below, which works fine it can be viewed for an
The uncommented code below yields an OperationalError: near? while the commented lines works fine.

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.