Banner image

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

380 memberDB.php INSERT INTO et_page_visits ( vuid,vpage,vreferrer,vtime,vlang,vagent,vbot,vversion,vguest,vip) VALUES ( "1","","Unknown","1534616740","","CCBot/2.0 (","","biscuits-12y","","") ON DUPLICATE KEY UPDATE vuid = "1" ,vpage = "" ,vreferrer = "Unknown" ,vtime = "1534616740" ,vlang = "" ,vagent = "CCBot/2.0 (" ,vbot = "" ,vversion = "biscuits-12y" ,vguest = "" ,vip = ""
538 engine.php getContent help