background preloader

AJAX

Facebook Twitter

Ajax - Asynchronous JavaScript + XML. Ajax, eine neues Schlagwort, das JavaScript wieder salonfähig gemacht hat und neue Formen der Nutzerführung für einige Webanwendungen erlauben soll.

Ajax - Asynchronous JavaScript + XML

Ajax steht für Asynchronous JavaScript + XML, es bezeichnet also die Kombination von JavaScript und XML. Nachfolgend ein Beispiel, dass Sie auch downloaden können, ein Glossar mit Ajax:Geben Sie eines der folgenden Wörter ein und achten Sie auf die Ausgabe während Sie schreiben. JavaScript muss natürlich im Browser aktiviert sein! (JavaScript, Java, Ajax, PHP) Link zum Download Anwendungsbeispiel Das Beispiel besteht aus einem Textfeld. In diesem Beispiel sind die Schlagwörter des Glossars der Einfachheit halber in einem Array versammelt. Anschließend sucht es die Schlagwörter des Glossars, die mit dem Suchbegriff übereinstimmen, und speichert diese in einem Array. Clientseitige Datei für das Ajax-Glossar (ajax.html): Die URL, die angefragt wird, ist das serverseitige Skript. <! If (xmlHttp) { xmlHttp.open('GET', 'ajax_server.php? Ajax PHP two Dependant drop down list with out reloading page. Please read the basic drop down list box control tutorial.

Ajax PHP two Dependant drop down list with out reloading page

We will try to develop similar functionality by using Ajax (asynchronous JavaScript and XML) and PHP. The biggest advantage of using Ajax here is we need not reload the page again. With more form components ( if already filled by visitor ) we have to re-fill all the data once the page reloads. Now without sending all the information back to server we can send only cat_id of selected first category and then we will manage the second list based on cat_id value. The detail tutorial on how to start with Ajax or how it works along with PHP is not explained here.

You can see the demo here and check the other related articles on this related drop down list at the end of this page. We have used one server side script written in PHP. Demo of two dropdown list using Ajax & PHP New script with multiple selection drop down list box is used. Demo with multiple selection dropdown list Three drop down list using Ajax. Website Design Ireland, Website Development.

One of the members on Irish WebMaster Forums asked for help in creating a simple dependent select menu and the most obvious option is by using Ajax, so I decided to put up this post with step-by-step instructions.

Website Design Ireland, Website Development

First, create a new PHP page (as we are going to use php for this) and name it “page1.php“. On this page we are going to add the following javascript code, which will take care of our XMLHTTP request. Now will create a simple form with two select menus and a submit button: <form name="select_m" id="select_m" action="<? Php echo $_SERVER['REQUEST_URI']. "? ". Now save page1.php and create a new page “page2.php“, where we are going to create the second select menu which will change its options based on the GET request: Save the second page, and using your preferred browser navigate to “page1.php”, make a selection and see how the second menu will change its values. How it works? ............ document.getElementById(containerid).innerHTML = xmlhttp_obj.responseText; ............