DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2007
    Posts
    3

    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

  2. #2
    Join Date
    Mar 2007
    Location
    In the Matrix
    Posts
    3
    Why did you post this twice?
    Last edited by WebGeek182; 03-14-2007 at 07:25 PM.

Similar Threads

  1. problem with java script in ajax
    By asmitaisit in forum AJAX
    Replies: 0
    Last Post: 03-02-2007, 09:05 AM
  2. AJAX form tag problem
    By kgarthai in forum AJAX
    Replies: 0
    Last Post: 02-19-2007, 08:31 PM
  3. Replies: 0
    Last Post: 02-17-2007, 03:36 PM
  4. Java RMI problem
    By sportacus in forum Java
    Replies: 5
    Last Post: 11-28-2005, 03:39 AM
  5. Replies: 1
    Last Post: 05-28-2002, 03:11 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


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


Sponsored Links