Advertisement

CHECKLIST WHEN YOUR AJAX SCRIPT FAILS

Moderators: Calcifer, slothy

CHECKLIST WHEN YOUR AJAX SCRIPT FAILS

Postby Batalf » Fri Jul 21, 2006 3:41 pm

Here are some of the things you should try if you're not able to make one of the ajax from this site work.

1) Make sure that you open the file over the http protocol.

The address in your browser should start with "http" and not "c:\".

2) Change method from "POST" to "GET" inside ajax.js

i.e.

change

Code: Select all
this.method = "POST";


to

Code: Select all
this.method = "GET";


Some webservers doesn't allow the script to use the "POST" method.

3) Some webservers only accepts ajax requests to files with a specific extension. Example: Some Microsoft web servers are configured to only accept ajax requets to file with the extension ".asp" or ".aspx".

To solve this, you either have to reconfigure the server or make changes to the script(i.e. rename the files with extension .html to .asp and also change it inside the js code).

4) change all .htm/.html files to .php

5) Check the path to your included files.
Make sure that the path defined to the file you want to include by ajax is correct.


--------------------------------------------------------------------------------
SACK DOCUMENTATION
--------------------------------------------------------------------------------
The doc link on the sack home page is down. You can try to download the documentation for http://php5.kcpug.org/ajax-fun/tw-sack/docs.html instead
Last edited by Batalf on Sat Jan 27, 2007 1:08 pm, edited 3 times in total.
Batalf
Site Admin
 
Posts: 2160
Joined: Sat Oct 22, 2005 9:38 pm

Postby HatakeKakashi » Fri Aug 25, 2006 7:50 pm

I'm also had luck fixing scripts that use php with the following:

4) change all .htm/.html files to .php

5) in every file that contains script, the php is usually bracketed off with <? $php_code ?>. I've found that for my php server, I need to change them all to <?PHP $php_code ?>, although this is probably a server option or something.
HatakeKakashi
 
Posts: 27
Joined: Tue Aug 01, 2006 7:33 pm


Return to General questions regarding AJAX scripts

Who is online

Users browsing this forum: No registered users and 0 guests

cron