![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#11 |
|
Programming Guru
![]() Join Date: Apr 2005
Posts: 1,730
Rep Power: 5
![]() |
Re: Problem with calling a function
It's been a while since I've done any work with Ajax, but I believe, by default, Ajax is browser dependant, so you must include an external .js file that will work out the compatibility for you. Feel free to correct me of course...
I believe it was "Sarissa" that I used before. |
|
|
|
|
|
#12 | ||
|
PHP God
|
Re: Problem with calling a function
Quote:
<script type="text/javascript">
var xmlHttp;
function initialize(){
try{
xmlHttp=new XMLHttpRequest();
}catch (e){
try{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}catch (e){
try{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}catch (e){
alert("Your browser does not support AJAX!");
return false;
}
}
}
}
function options(cmd){
initialize();
xmlHttp.onreadystatechange=function()
{
if(xmlHttp.readyState == 4)
{
document.getElementById("show_box").innerHTML = xmlHttp.responseText;
}
}
xmlHttp.open("POST","http://www.staticfire.co.uk/ajaxrequest.php?cmd=" + cmd,true);
xmlHttp.send(null);
}
</script>Quote:
try{
xmlHttp=new XMLHttpRequest();
}catch (e)
__________________
mysql_query("DELETE chavs FROM earth") or die("chavs"); |
||
|
|
|
|
|
#13 |
|
Expert Programmer
Join Date: Jun 2005
Posts: 799
Rep Power: 3
![]() |
Re: Problem with calling a function
I can't see anything that would cause a "length required" message. One thing you could do is debug through it using a Firefox add-on such as FireBug. This will let you step through the script and set breakpoints etc.
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Calling an undeclared or undefined function in C/C++ | climbnorth | C | 2 | Oct 8th, 2006 12:02 AM |
| problem with a function | brad sue | Other Programming Languages | 3 | Apr 23rd, 2006 10:24 PM |
| problem with standard function | sparda | C | 8 | Oct 26th, 2005 2:27 PM |
| Problem passing multi-dimensional array to function | aznluvsmc | C | 2 | Aug 30th, 2005 10:00 PM |
| Problem when returning a string from a function in VC++ | vjkancha | C++ | 10 | Mar 7th, 2005 1:18 PM |