-
problem with java script in ajax
this is my ajax obj function
function ajaxFunction(){
var ajaxRequest; // The variable that makes Ajax possible!
try{
// Opera 8.0+, Firefox, Safari
ajaxRequest = new XMLHttpRequest();
} catch (e){
// Internet Explorer Browsers
try{
ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try{
ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e){
// Something went wrong
alert("Your browser broke!");
return false;
}
}
}
return ajaxRequest;
}
and
this is my main function
function chkUsername()
{
verifyuname=1;
var illegalChars = /\W/;
var uname=document.getElementById("unamecom");
uname.innerHTML="Please wait..";
username=document.getElementById("uname").value;
if(username.length<4)
{
uname.innerHTML="<font color='red'>Too short</font>";
verifyuname=0;
return;
}
else if (illegalChars.test(username)) {
uname.innerHTML="<font color='red'>The username contains illegal characters.</font>";
verifyuname=0;
}
xmlHttp=null;
xmlHttp=ajaxFunction();
url="checkregis.php";
url=url+"?username=username";
xmlHttp.onreadystatechange=stateChangedchkUsername
xmlHttp.open("GET",url,true) //SHOWS java script runtime ERROR HERE
xmlHttp.send(null) //that permission denied..thers no prob
} //wid DB username n pwd as i chkd a
//simplr ajax code wid that
thnx in advance
-
Why did you post this twice?
Last edited by WebGeek182; 03-14-2007 at 07:25 PM.
Similar Threads
-
By asmitaisit in forum AJAX
Replies: 0
Last Post: 03-02-2007, 09:05 AM
-
By kgarthai in forum AJAX
Replies: 0
Last Post: 02-19-2007, 08:31 PM
-
Replies: 0
Last Post: 02-17-2007, 03:36 PM
-
By sportacus in forum Java
Replies: 5
Last Post: 11-28-2005, 03:39 AM
-
Replies: 1
Last Post: 05-28-2002, 03:11 AM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks