Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
BOOK: Professional Ajax ISBN: 978-0-471-77778-6
This is the forum to discuss the Wrox book Professional Ajax by Nicholas C. Zakas, Jeremy McPeak, Joe Fawcett; ISBN: 9780471777786
Important: For the new 2nd edition of this book, please post here instead: [url="http://p2p.wrox.com/forum.asp?FORUM_ID=307"]http://p2p.wrox.com/forum.asp?FORUM_ID=307[/url]
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional Ajax ISBN: 978-0-471-77778-6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old July 13th, 2006, 05:53 AM
Registered User
 
Join Date: Jul 2006
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default responseText not working in FireFox

Hi All, I've just bought the book and started with AJAX and already I'm banging my head in frustration. To try AJAx out I'm using the following code. It works just fine in IE but in FireFox I get nothing. No alert, no errors nothing. The worst bit is it is working in as much as the POSTDATA is sent and processed correctly but as soon as it moves into the callback function (handleResponse) I can't get anything out of it. Hope someone can see the flaw.

Code:
function createRequestObject() {
    var ro;
    var browser = navigator.appName;
    if(window.ActiveXObject){
        ro = new ActiveXObject("Microsoft.XMLHTTP");
    }else{
        ro = new XMLHttpRequest();
        if (ro.overrideMimeType) {
            ro.overrideMimeType('text/html');
         }
    }
    return ro;
}
function sndReq(field,val) {
    validate = createRequestObject();
    globCurAJAXField = field;
    validate.onreadystatechange = handleResponse;
    validate.open('POST', 'updateDB.php');
    validate.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    validate.send(###POSTDATA###);
}
function handleResponse() {
    var result;
    if(validate.readyState == 4){
        if(validate.status == 200) {
            result = validate.responseText
            alert("result :" + result);
        }
    }
}


Similar Threads
Thread Thread Starter Forum Replies Last Post
innerHTML tag is not working in firefox johnpaul8182 ASP.NET 2.0 Professional 0 March 4th, 2008 07:29 AM
parent.location.reload() not working in FireFox AbrarNazeer Javascript 3 February 25th, 2008 05:35 AM
transformNode not working in firefox picky Javascript 0 December 20th, 2007 01:54 AM
Blog with FCKeditor not working in Firefox cwh BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 5 March 20th, 2007 01:35 AM
logout not working in firefox sen22 ASP.NET 2.0 Basics 0 January 25th, 2007 04:21 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.