We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 32963
    • 1,732 Posts
    Hi Everyone,

    I just thought I would share this will all those who would like to be able to debug their AJAX apps very quickly smiley

    IMO Zend Studio Pro is a big timer saver. It’s expensive but it’s debugging features are very good. I don’t know if eclipse can do the same but it’s very easy with Zend Studio Pro (Evaluation) smiley

    Trust me it will save you lots of time!

    AJAX Javascript code:
    /**
     * Support for debugging AJAX apps with Zend Studio with Zend studio server
     *
     * @param: boolean state 
     * @param: string host - ip address of remote server (optional)
     *
     */
    var debugUrlParams = '';
    function enableZendDebugMode(state,host) {
    	var ip = '';
    	if (host) ip = host+'%2C127.0.0.1';
    	// Zend Studio debug url info
    	if(!state) debugUrlParams = '';
    	else base.debugUrlParams = '?start_debug=1&debug_port=10000&debug_fastfile=1& ;debug_host='+ip+'&send_sess_end=1&debug_no_cache=1142283433288&debug_stop=1&debug_url=1&debug_new_session=1';	
    }
    
    // quickly little wrapper to send AJAX request using Prototype
    function update(id,url) {
    	var url  = url + debugUrlParams;
    	new Ajax.Updater(id,url);
    }


    example:
    // from browser
    update('mydiv','index.php');
    
    // from index.php
    <?php
       $i = 10; // add bookmark to this line.
       echo $i/2;
    ?>
      xWisdom
      www.xwisdomhtml.com
      The fear of the Lord is the beginning of wisdom:
      MODx Co-Founder - Create and do more with less.