943,938 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 6054
  • PHP RSS
Jul 31st, 2007
0

AJAX And PHP

Expand Post »
Hai friends,
Please help me that how can i solve this problem,
how can i include AJAX in PHP,Can u tell me that how can i configure system for AJAX.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
venu@baylogic is offline Offline
18 posts
since Jul 2007
Jul 31st, 2007
0

Re: AJAX And PHP

You need to learn more about Ajax as you don't include ajax into PHP. In fact PHP really doesn't even care or know about Ajax. All you need to know with your PHP code is whether or not to send out XML headers or not. That's it.
Moderator
Reputation Points: 161
Solved Threads: 38
He's No Good To Me Dead
stymiee is offline Offline
1,422 posts
since May 2006
Jul 31st, 2007
0

Re: AJAX And PHP

Last edited by MitkOK; Jul 31st, 2007 at 12:12 pm.
Reputation Points: 59
Solved Threads: 12
Junior Poster
MitkOK is offline Offline
142 posts
since Jul 2007
Aug 1st, 2007
0

Re: AJAX And PHP

Thank U Friend for Ur reply...........
Can U give more explanation about it.........
Reputation Points: 10
Solved Threads: 0
Newbie Poster
venu@baylogic is offline Offline
18 posts
since Jul 2007
Aug 2nd, 2007
0

Re: AJAX And PHP

Hai friend,
Can U tell me that how can i solve this error,
its giving error i.e printing whole "xajax_core.js" file,
<?php
require('xajax_core/xajax.inc.php');
require('xajax_js/xajax_core.js');
$xajax=new xajax();
$xajax ->registerFunction("helloWorld");

function helloWorld($isCaps)
{
if ($isCaps)
$text = "<b>BAYLOGIC TECHNOLOGIES...VENU !</b>";
else
$text = "<b>baylogic technologies...venu!</b>";

$objResponse = new xajaxResponse();
$objResponse->assign("div1","innerHTML",$text);

return $objResponse;
}
function setColor($sColor)
{
$objResponse = new xajaxResponse();
$objResponse->assign("div1","style.color", $sColor);

return $objResponse;
}
$xajax->registerFunction("helloWorld");
$xajax->registerFunction("setColor");
$xajax->processRequest();

echo '<?xml version="1.0" encoding="UTF-8"?>';
?>

<html>
<head>
<title>xajax example</title>
<?php
// output the xajax javascript. This must be called between the head tags
$xajax->printJavascript();
?>
<script type='text/javascript'>

window.onload = function() {
// call the helloWorld function to populate the div on load
xajax_helloWorld(0);
// call the setColor function on load
xajax_setColor(document.getElementById('colorselect').value);
}

</script>
</head>
<body style="text-align:center;">
<div id="div1" name="div1"> </div>
<br/>

<button onclick="xajax_helloWorld(0)" >Click Me</button>
<button onclick="xajax_helloWorld(1)" >CLICK ME</button>
<select id="colorselect" name="colorselect"
onchange="xajax_setColor(document.getElementById('colorselect').value);">
<option value="black" selected="selected">Black</option>
<option value="red">Red</option>
<option value="green">Green</option>
<option value="blue">Blue</option>
<option value="yellow">Yellow</option>
<option value="cyan">Cyan</option>
</select>
</body>
</html>
Reputation Points: 10
Solved Threads: 0
Newbie Poster
venu@baylogic is offline Offline
18 posts
since Jul 2007
Aug 2nd, 2007
0

Re: AJAX And PHP

Iam getting this error,,,,
Error:The xajax JavaScript component could not be included, Perhaps the URL is incorrect?
URL:xajax/xajax_core.js
Last edited by venu@baylogic; Aug 2nd, 2007 at 4:21 am. Reason: mitkok,mitk0k
Reputation Points: 10
Solved Threads: 0
Newbie Poster
venu@baylogic is offline Offline
18 posts
since Jul 2007
Aug 2nd, 2007
0

Re: AJAX And PHP

Iam getting this error,,,,
Error:The xajax JavaScript component could not be included, Perhaps the URL is incorrect?
URL:xajax/xajax_core.js
Reputation Points: 10
Solved Threads: 0
Newbie Poster
venu@baylogic is offline Offline
18 posts
since Jul 2007
Aug 3rd, 2007
0

Re: AJAX And PHP

There's no need for you to include the .JS file like that. Use

<script type="javascript" src="xajax_js/xajax_core.js"></script>
Reputation Points: 15
Solved Threads: 17
Junior Poster
phper is offline Offline
189 posts
since Nov 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: Related Searches/Queries Script.. Help!
Next Thread in PHP Forum Timeline: images and drop down list boxes





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC