Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > JavaScript > BOOK: Professional Ajax ISBN: 978-0-471-77778-6
Password Reminder
Register
Register | FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old July 13th, 2006, 06: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);
        }
    }
}
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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 02:35 AM
logout not working in firefox sen22 ASP.NET 2.0 Basics 0 January 25th, 2007 04:21 AM



All times are GMT -4. The time now is 04:20 PM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.