XAJAX

03 Jun 2009

Basically using xajax “You can directly call php functions from your javascript code”

Xajax will do the rest. 

For example, if you are going to write a javascript function Capitalize which captilaze your textbox content when you press a button.

Here is the pure html/javascript code for that:

=============================================

<script>

function Capitalize()

{

      var t = document.getElementById(‘cap’).value;

      document.getElementById(‘update’).innerHTML = t.toUpperCase() ;

}

</script>

 

<input type=”text” id=”cap” name=”cap” />

<input type=”button” id=”capbutton” value=”Capitalize” onclick=”Capitalize()” />

<div id=”update”></div>

==============================================

Now see the difference when we use xajax, we can write this Capitalize function in php code and can call from javascript.

function Capitalize($value)

{

    $objResponse = new xajaxResponse();

    $objResponse->assign(“update”,”innerHTML”,strtoupper($value));

    return $objResponse;

}

and you can call from your button’s onclick function:

 onclick=”xajax_Capitalize(document.getElementById(‘cap’).value)” 

Here the same functionality we moved from client to server. Thus the point is you can simply call all the functions you written in php (Server Side) from javascript code via onClick, onMouseOver or window.onLoad etc.

You can get the full source code of Capitalize example here:

http://www.sajithmr.com/downloads/capitalize.zip

To download and for documentation go: 

http://xajaxproject.org/

Thanks

Sajith

Tags: , , , , , , , ,

· · · ◊ ◊ ◊ · · ·

Recently some quotes struck my mind from a forwared email. It is basically , i think, 100% true , even though described in as a  funny way.

See:

  1. Project Manager is a Person who thinks nine Women can deliver a baby
    in One month
  2. Developer is a Person who thinks it will take 18 months to deliver a Baby.
  3. Onsite Coordinator is one who thinks single Woman can deliver nine
    babies in one month
  4. Client is the one who doesn`t know why he wants a baby
  5. Marketing Manager is a person who thinks he can deliver a baby even
    if no man and woman are available
  6. Resource Optimization Team thinks they don`t Need a man or
    woman;They`ll produce a child with zero resources
  7. Documentation Team thinks they don`t care whether the child is
    delivered, they`ll just document 9 months.
  8. Quality Auditor is the person who is never happy with the PROCESS to
    produce a baby.And lastly……
  9. Tester is a person who always tells his wife that this is not the Right baby

Courtesy: Some Forwared Email

Tags: , , , , , , , , , ,

· · · ◊ ◊ ◊ · · ·

وظائف 2011 تحويل العملات برامج برنامج تسريع التحميل برنامج الفلاش برنامج محول الصوتيات عربي hotel 2011 زيادة رواتب العساكر 1431