Prev | Current Page 522 | Next

Emilian Balanescu and Cristian Darie

"Beginning PHP and MySQL E-Commerce: From Novice to Professional, Second Edition"

responseText;
// Server error?
if (response.indexOf("ERRNO") >= 0 || response.indexOf("error") >= 0)
{
handleError(response);
}
else
{
// Extract the contents of the cart_summary div element
var cartSummaryRegEx = /^
???
([\s\S]*)<\/div>$/m;
matches = cartSummaryRegEx.exec(response);
response = matches[1];
// Update the cart summary box and hide the Loading message
document.getElementById("cart-summary").innerHTML = response;
// Hide the "Updating..." message
document.getElementById('updating').style.visibility = 'hidden';
}
}
4. Open presentation\templates\store_front.tpl, and add a reference to your JavaScript file,
ajax.js:


CHAPTER 13 ?–  IMPLEMENTING AJAX FEATURES 418
{$obj->mPageTitle}

rel="stylesheet" />


5. Modify index.php as highlighted:
// Load Business Tier
require_once BUSINESS_DIR . 'catalog.php';
require_once BUSINESS_DIR . 'shopping_cart.php';
// URL correction
Link::CheckRequest();
// Load Smarty template file
$application = new Application();
// Handle AJAX requests
if (isset ($_GET['AjaxRequest']))
{
// Headers are sent to prevent browsers from caching
header('Expires: Fri, 25 Dec 1980 00:00:00 GMT'); // Time in the past
header('Last-Modified: ' .


Pages:
510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534
podłogi drewniane prezenty AC/DC meble drewniane Teksty piosenek