First if this is obviouse to som I am sorry as I am just starting with Javasript and ajax
I have created a simple page for a web site that replaces the text DIV with html from template pages to give a clen insertion and no page loads.
CODE------
// AJAX Send
function AjaxLoad(page_url, div_id)
{
// register the callbacks
var local_handle_reply = handle_reply;
var local_handle_error = handle_error;
// callback binder
function bindcallback()
{
if (req.readyState == 4) {
if (req.status == 200) {
TEST:local_handle_reply(re
q.response
Text, div_id);
//handle_reply();
} else {
local_handle_error(req);
}
}
}
// send request to the server
if (window.XMLHttpRequest)
{
//native XMLHttpRequest browsers
var req = new XMLHttpRequest();
req.onreadystatechange = bindcallback;
req.open("GET", page_url, true);
req.setRequestHeader('Cont
ent-Type',
'applicati
on/x-www-f
orm-urlenc
oded');
req.send('');
}
else if (window.ActiveXObject)
{
// IE/Windows ActiveX browsers
var req = new ActiveXObject("Microsoft.X
MLHTTP");
if (req)
{
req.onreadystatechange = bindcallback;
req.open("GET", page_url, true);
//req.setRequestHeader('Co
ntent-Type
','applica
tion/x-www
-form-urle
ncoded');
req.send('');
}
}
return "done";
}
// AJAX handle_reply
function handle_reply(reply, div_id)
{
document.getElementById(di
v_id).inne
rHTML = reply;
// clean up
delete(reply);
}
// AJAX handle_error
function handle_error(req)
{
}
CODE ----
I have wampserver installed localy on my machine running
PHP Version 5.2.1
System Windows NT COMPAQ 5.1 build 2600
Build Date Feb 7 2007 23:10:31
Configure Command cscript /nologo configure.js "--enable-snapshot-build" "--with-gd=shared"
Server API Apache 2.0 Handler
Virtual Directory Support enabled
Configuration File (php.ini) Path C:\wamp\Apache2\bin\php.in
i
PHP API 20041225
PHP Extension 20060613
Zend Extension 220060519
Debug Build no
Thread Safety enabled
Zend Memory Manager enabled
IPv6 Support enabled
Registered PHP Streams php, file, data, http, ftp, compress.zlib
Registered Stream Socket Transports tcp, udp
Registered Stream Filters convert.iconv.*, string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed, zlib.*
it works fine exactly as planned. BUT I upload to my web server witch is running
PHP Version 4.4.4
System Linux universe.websiteactive.com
2.6.18.2-ts.grh.mh.i386 #1 SMP Sat Nov 18 04:56:38 CST 2006 i686
Build Date Aug 28 2006 07:25:30
Configure Command './configure' '--with-apxs=/usr/local/ap
ache/bin/a
pxs' '--prefix=/usr/local' '--with-xml' '--enable-bcmath' '--enable-calendar' '--with-curl' '--with-dom' '--with-dom-xslt' '--with-dom-exslt' '--enable-exif' '--enable-ftp' '--with-gd' '--with-jpeg-dir=/usr/loca
l' '--with-png-dir=/usr' '--with-xpm-dir=/usr/X11R6
' '--with-gettext' '--with-iconv' '--with-imap=/usr/local/im
ap-2004g' '--enable-mbstring' '--enable-mbstr-enc-trans'
'--enable-mbregex' '--with-mcrypt' '--with-mhash' '--enable-magic-quotes' '--with-mysqli' '--with-mysql=/usr' '--with-openssl' '--enable-discard-path' '--with-pear' '--with-pspell' '--enable-sockets' '--enable-track-vars' '--with-ttf' '--with-freetype-dir=/usr'
'--enable-gd-native-ttf' '--enable-wddx' '--with-zip' '--with-zlib'
Server API Apache
Virtual Directory Support disabled
Configuration File (php.ini) Path /usr/local/Zend/etc/php.in
i
PHP API 20020918
PHP Extension 20020429
Zend Extension 20050606
Debug Build no
Zend Memory Manager enabled
Thread Safety disabled
Registered PHP Streams php, http, ftp, https, ftps, compress.zlib
and nothing happens. There are no errors no warnings nothing it just dont work
WHAT AM I MISSING HERE. PLEASE HELP
and nothing
Start Free Trial