Content / help / ajax .. concise-view << previous next >>

Ajax Javascript with Biscuits MVC Framework

Some notes on the way ajax is used in biscuits the MVC framework
When PHP is loaded by ajax, it is like a fresh start. You lose all the PHP environment and might have to set some environment variables inside this script again
ini_set('display_errors', '1'); for example.
Note that any DOM related CSS classes etc., will exist as your new PHP is loading into a DIV within the existing page.
Sometimes an ajax call from an onclick fails from a <button> but works from a <div> or <span>
I don't know why this should be, perhaps there's a problem inside biscuits with js or CSS

List of PHP scripts loaded by ajax

  1. ajax-chat.php
  2. ajax-likes.php
  3. ajax-member.php
  4. ajax-news.php
  5. ajax-slides.php
  6. ajax-tracker.php
  7. ajaxloader.php

    Legacy Ajax script, before introducing separate scripts for each area.

Example of biscuits ajax method

   phpScript = 'ajax-chat.php';
    var loadData = {
        userid: tap.userid,
        prefix: tap.prefix,
        userlang: tap.userlang,
        sitelang: tap.sitelang,
        action: 'lastChatTime',
        thisdiv: 'ajax-load'

    etAjaxLoad(phpScript, 'ajax-load', loadData);

iBiscuits LOGO