How can I call multiple PHP scripts with AJAX/JQuery? -
I'm new to AJAX and JQuery I'm trying to use it to call two PHP scripts. I got some examples online but to call the function. I'm just trying to call scripts, so it will load everything on my main PHP file, which will then show results on screen. Bold example here, it works if I put all my PHP scripts in a file: Thanks in advance, your help is greatly appreciated. ! main_php file (where I want to call my other PHP scripts): display_desk.php (I want to call scripts): ? What about it ?: Be sure to add $ (document) .ready (function () { }); < / P> / edit / Do you want to use Ajax? Done:
& lt; Include php 'db_conn.php'; // Query to obtain X, YDES coordinates for $ DESKS desk_coord_sql = "SELECT coordine_id, x_coord, y_coord FROM coordinates"; $ Desk_coord_result = mysqli_query ($ conn, $ desk_coord_sql); // See if the query is good ($ desk_coord_result === incorrect) {dead (mysqli_error ()); } // didsplay maps desk stations ($ line = mysqli_fetch_assoc ($ desk_coord_result)) {// naming x, y value $ id = $ line ['coordinate_ID']; $ X_pos = $ line ['x_coord']; $ Y_pos = $ line ['y_coord']; // Draw a box with a div in your X, consolidate Y, "
$. Post ("yourURL.php", function (html) {/ * here what you want to do * / / * your script in HTML}};
Comments
Post a Comment