www.webdeveloper.com
Results 1 to 2 of 2

Thread: beginner in ajax need help

  1. #1
    Join Date
    Nov 2011
    Posts
    35

    Exclamation beginner in ajax need help

    hi iwant know why this code don't work with me itry make user buy wood and then update his information in datebase

    <html>
    <head>
    <script language="javascript" type="text/javascript">
    <!--

    function buy(nomber,ink){
    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;
    }
    }

    }
    // Create a function that will receive data sent from the server
    ajaxRequest.onreadystatechange = function(){
    if(ajaxRequest.readyState == 4){

    }
    }
    ajaxRequest.open("GET",ink, true);
    ajaxRequest.send('nomber='+nomber);


    }

    nomber="";
    function submitnum(bname){
    nomber+=document.getElementById(bname).value+"";
    document.getElementById(bname).value="";
    }
    //-->
    </script>
    </head>
    <body bgcolor=#CCA37A>


    <table align=left width=600>
    <tr><td bgcolor=orange colspan=2>Market</td></tr>
    <tr><td onmouseover="this.style.background='#FECE6E'; ajaxFunction('buildinfo.php?type=wood','info');"
    onmouseout="this.style.background='#CCA37A'">Wood</td><td><input type=text id=bi><input type=submit onclick="submitnum('bi');buy(nomber,'buy.php');"></td><td rowspan=3><div id=info></div></td></tr>

    </table>


    </td></tr></table>
    </body>
    </html>

  2. #2
    Join Date
    Nov 2011
    Posts
    35

    Any 1 can help me?

    Any one can reply and tell me whats wrong why this code don't work?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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



Recent Articles