خطاهاي زير اتفاق افتاده‌است
Warning [2] Cannot modify header information - headers already sent by (output started at /home/parsig/public_html/Forum/inc/languages/persian/permbox.lang.php:1) - Line: 1535 - File: inc/functions.php PHP 5.2.13 (Linux)
File Line Function
[PHP]   errorHandler->error
/inc/functions.php 1535 header
/inc/functions.php 1596 my_setcookie
/inc/functions_indicators.php 52 my_set_array_cookie
/showthread.php 456 mark_thread_read



تبلیغات در پارسیگ




ارسال پاسخ 
 
رتبه موضوع
  • 1 راي - 4 ميانگين
  • 1
  • 2
  • 3
  • 4
  • 5
learn xajax in 10 minutes
10-26-2009, 09:23 AM
شماره : #1
learn xajax in 10 minutes
xajax is designed to be extremely easy to implement in both existing web applications as well as new projects. You can add the power of xajax to nearly any PHP script in seven easy steps:
1. Include the xajax class library:
Code: php
require_once("xajax_core/xajax.inc.php");
2. Instantiate the xajax object:
Code: php
$xajax = new xajax();
3. Register the names of the PHP functions you want to be able to call through xajax:
Code: php
$xajax->registerFunction("myFunction");
4. Write the PHP functions you have registered and use the xajaxResponse object to return XML commands from them:
Code: php
function myFunction($arg)
{
// do some stuff based on $arg like query data from a database and
// put it into a variable like $newContent
$newContent = "Value of $arg: ".$arg;
// Instantiate the xajaxResponse object
$objResponse = new xajaxResponse();
// add a command to the response to assign the innerHTML attribute of
// the element with id="SomeElementId" to whatever the new content is
$objResponse->assign("SomeElementId","innerHTML", $newContent);
//return the xajaxResponse object
return $objResponse;
}
5. Before your script sends any output, have xajax handle any requests:
Code: php
$xajax->processRequest();
6. Between your tags, tell xajax to generate the necessary J
Code: php
<?php $xajax->printJavascript(); ?>
7. Call the function from a JavaScript event or function in your application:
Code: html
<div id="SomeElementId"></div>
<button onclick="xajax_myFunction('It worked!');"></pre>
That's it. xajax takes care of most everything else. Your biggest task is writing the PHP functions and returning xajax XML responses from them-- which is made extremely easy by the xajaxResponse class.
مشاهده وب سايت اين کاربر يافتن تمام ارسال‌هاي اين کاربر
نقل اين ارسال در يك پاسخ
تشکر شده توسط : Morteza, parazitt
ارسال پاسخ 


پرش به انجمن:


قوانين ارسال
شما نمی توانید تایپک جدید ارسال کنید.
شما نمی توانید به تایپک پاسخ دهید.
شما نمی توانید فایل ضمیمه کنید.
کد های Html غیر فعال است.
MyCode فعال است.
شکلک ها فعال است.
کد [img] فعال است.