Sign In/My Account | View Cart  
advertisement

Article:
 Very Dynamic Web Interfaces
Subject: Header Output
Date: 2007-02-13 00:20:37
From: tame_one

This drove me batty for three hours. For those like myself who are fluent in PHP but don't have a clue about AJAX, anything that would trip up an HTML document by modifying headers out of turn will also cause errors in AJAX. Difference is, you don't get the benefit of detailed error information.


I kept getting "req.responseXML has no properties" until I figured that out. DOH! Hope this helps someone else.


Previous Message Previous Message   Next Message Next Message


Titles Only Titles Only Newest First
  • Header Output
    2007-02-22 19:02:21 Davin_Thompson

    A quick little fix to that for debugging and beyond... It'll save you hours of headache!


    For your php backend pages, redefine the error handeler and output all errors to a logfile. You can then tail that logfile, see all warnings and errors, without throwing your entire ajax response =)


    quickie example from memory:


    set_error_handler(log_to_file);
    ...
    ...
    function log_to_file($errnum, $errstr) {
    $log = fopen("logfile.txt", "+w");
    fwrite($log, $errstr);
    }



Sponsored By: