Jump to content

Search the Community

Showing results for tags 'AJAX'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start





Website URL








  1. BACKGROUND: I have a javascript document that is dynamically loaded when a certain condition is met. In this document there are two functions: the first function is called submitForm(), and the second is called resetForm(). Each of these functions is triggered separately by a different button on the same HTML webpage. Both functions rely on the same PHP class, but each relies on data created by a different instance containing different data. The first instance is created at run time and is ultimately read into the submitForm() function. The second instance is created at the visitor's d
  2. Crann

    AJAX write

    I am tying to make a file that will write to another file.
  3. Attention: W3schools Javascript forum members: Earlier this morning I coded a simple AJAX script to post a line of text and a button to a web page and then, upon clicking the button, to print the text ( in the "ajax_1.txt" file ) to the web page. The AJAX script is as follows: <!DOCTYPE html> <html> <body> <div id="demo"> <h1>Let AJAX print this text</h1> <button type="button" onclick="loadDoc()">Print Content</button> </div> <script> function loadDoc() { var xhttp = new XMLHttpRequest(); xhttp.onreadystatech
  4. Hello potential helpers, im currently having issues with firing an ajax request inside of another ajax request. Heres my code: Im not getting "alert(content)" Condition if(shop[1] == "gserver") and if(name.includes(shopname) == true) are definetly true. The function is correctly called as well. No Im not using jquery for reasons. Anyone has an idea why the 2nd requests isnt fired? Is it not waiting for the first one to finish? function initiate_shop_game(shopname) { var xmlhttp = new XMLHttpRequest(); xmlhttp.onreadystatechange = function()
  5. Hi Am trying to submit the data to server, nothing is received on server. I mean "dismissed students" and "failed students " am filling and sending but not receiving on server side. How to get the data on server side. <div id="Examination" class="tabcontent"> <html> <body> <p id="exam"></p> dismissed students: <input type="text" name="index1" size="10"> <br><br> failed students: <input type="text" name="index2" size="10">
  6. GENERAL QUESTION: Can variables created outside of a function be used within a function without having to read them first as arguments of the function? If so, can a function created within a function use a variable created outside of both functions? CODE var dataString = 'search_input=' + search_letter_input; $.ajax({ type: "POST", url: './...', data: dataString, dataType: 'JSON', statusCode: { 404: function() { alert( "Page not found" ); }}, success: function(jsonData) {...} }); SPECIFIC QUESTION: I would like to use the value of the variable
  7. BACKGROUND: I have now tried a number of ways to make two cURL calls within the same Javascript (jQuery) routine. For each new way, I have discovered what I believe to be a reasonable explanation for my failure. For my most recent attempt, however, a good explanation is not forthcoming. To be sure, single AJAX calls with a single cURL call for each yield the desired results. Simply I cannot seem to combine these results simultaneously on the same page. The scenario given below, for example, returns the desired outcome for the second cURL call, but not the first. JAVASCRIPT: $.aj
  8. BACKGROUND: I have a plain text file with an .html extension. In the file is a <p> element into which I would like to enter the current date. The file is called from its hostpage via a jQuery $.get() statement that is followed with an AJAX call to a PHP processing file that returns JSON that can be processed in the AJAX success function as an object. QUESTION: If I place the PHP necessary to create the date in the text file with the .html extension, will it appear in the hostpage when called by the $.get() method? NOTE: My server is programmed to accept PHP in files with a
  9. How i make a Real time comment-replay script system in a website ?
  10. GREETING: One more quick question before the weekend begins. BACKGROUND: Until now, it has been easy to see the results of AJAX calls in the files that produce them. Until now, cURL was never an explicit part of my web-application. I am now making a dual call, however, and am unable to see the final result. The first call stipulates no method as nothing is sent. The second call is based on the result of the first call and uses the POST method to make the request. Although I can see the contents of the first request, I cannot see the contents of the second. Both files use identica
  11. BACKGROUND: A visitor arrives on a website. While still on the site he triggers an AJAX call that fills a <div> element with new HTML. Once the page is filled another AJAX call is made that seeks to read the following value as encoded JSON: $_SERVER['REMOTE_REFERER']. Instead I receive a 500 internal server error. The AJAX (function() { $("#main").html(''); $("<link/>", { rel: "stylesheet", type: "text/css", href: "./_utilities/css/yourprofile_filler.css" }).appendTo("head"); $.get('./yourprofile_filler.html', function(data) { $('#main').html(data);
  12. BACKGROUND: I am querying a MySQL database with a Matomo GUI. The API is called imageGraph. The call to the API works, as I have produced the desired image by assigning the URL as the value of an href attribute of an HTML <a> element. When using this link to display the image the image appears on a new page with its own header. This is not the effect that I desire. My goal is to display the image within a <div> tag on a webpage. The code that is suppose to achieve this latter effect is provided below. The URL that fetches the data from the API is identical for both the link
  13. i was trying to use a ajax returned value out of the ajax function but it didn't work. can anyone please guide me. here is the code i tried. var lat, lng; $.ajax({ url: url, dataType: "json", method: "get", success: function(res) { var lat = res[imei].lat; var lng = res[imei].lng; } }); $("#lng").text(lng); $("#lat").text(lat); thanks in advance.
  14. hello all, i am trying to run an ajax request inside a for loop. and when the response is true, i want to run another ajax only once. but the second ajax also runs multiple times. here is the code i tried .... var i; for (i=0; i< feeid.length; i++) { $.ajax({ url: "submitnewjournal.php", method: "POST", data: { m: m, fullvn: fullvn, vn: vn, }, }) .done (function(result) { var success = $(result).filter("#success").text(); $("#msg").text($(result).filter("#msg").text()); if (suc
  15. I've built a static site with over 40,000 pages using Jekyll. I am trying to implement a live search into it without a database. I tried the w3schools live search example with a xml file I created from my site. It is very slow. Does anyone know of a faster way to parse xml files or am I wasting time. I enabled gzip compression on the entire site also, What would be the fastest way to search a lot of records and return a result? Thanks in advance.
  16. BACKGROUND: My objective is to replace the content of an existent <div> element with new content that depends on newly loaded javascript, css, and a JSON object retrieved from a PHP processing file by an AJAX call. To this end I have written the following brief piece of code. To be clear the script contained in wordcount.js depends on the value of wordmax. Further this same script is triggered when text is entered into a <textarea> form control found in newsletter.html. Please review the code and answer the questions that follow. .click(function() { $('#main').html('
  17. BACKGROUND: I have learned to keep a log that increases incrementally with the generation of each new newsletter and podcast. 1) Read the Current Log Value $file = './episode_index.txt'; if (file_exists($file)) { $json_str = file_get_contents($file); $episode_no = json_decode($json_str, true); $number = $episode_no['episode_no']; $new_episode = $number + 1; } else { echo 'The desired file either does not exist, or does not exist in the indicated location.'; } 2) Take Some Action and Update the Log Value Incrementally if (!is_blank($_POST['letter_no'])) { $episod
  18. BACKGROUND: I have created a PHP routine that gathers data from a MySQL database. The data that it gathers depends on the value of an HTTP request that uses the $_GET superglobal as its transfer mechanism. The routine further organizes the retrieved information into a nested array such that each element of the array corresponds to a different table row, and each element of each nested array corresponds to a subset of the table fields. Once the nested array has been completed the json_encode() function converts the array into a JSON string and readies it for transport. The PHP <
  19. Hi all, I'm just starting to get into website design, tho' I've been a programmer for many years. I've got a site going pretty well, but I really want to update the information on the site every day using tables. I am studying the AJAX/XML method and I think I must be missing something. After using the 'display CD collection' as a model, I couldn't get it to work. So then I tried copying & pasting the actual files from the example ( they list the xml file for your reference ) into a folder and Opened it with a google browser. I can get the button that says 'create my CD collection'
  20. RECENT DISCOVERY: I recently discovered a handy PHP function called show_source( ) and would now like to apply it in a particular sort of way. GOAL: I would like to open a new tab in my current window that shows the source code of a page that I have opened in the window. DILEMMA: Since PHP operates before a page is opened I am a lot confused about how to make this happen. This is what I have accomplished so far. $( document ).ready(function() { console.log( "ready!" ); $('.show_src a').on('click', function(event) { event.preventDefault(); var address = $(this).at
  21. Hi... I am inside Ajax success function... here is my code... I have accessed the client server url successfully, but also I have to execuet the query that i have to get the result inside the Ajax function to post in my jsp page..... can someone please assist on how we can acheive this? function Call() { var query='select * from employees'; var querystring = "joinType=3&userLocale=English&query="+query&maxrow="2; $.ajax({ url:'https://testurl', type:'POST', success: function(data, url, jqhxr)
  22. I have a coded servlet already in HTTP url. I want to access and display the data from (http url) servlet to my new JSP within <div> here is the more details :https://gist.github.com/theakathir/f6fb390d35b451a57958aa0d3cf05330 about the servlet content. I am very new Ajax,. All i want to do in, In my new jsp page i will have a button to click which will access the data from the http url (servlet) using Ajax. Can someone direct me with some reference to start with.. It would be helpful Thanks.
  23. First off, thanks for letting me into the forums. Excuse a newbie but I have a question about fetching data from a database with PHP and AJAX. Let's say I wanted to fetch data from the database like in this example from W3Schools, but I had modified the dropdown to for example fetch all entries with last name Griffin, Swanson or Quagmire. I made the q variable take a string instead of an integer. $q = strval($_GET['q']); Now I want to expand the SQL query to also take another condition. "SELECT * FROM user WHERE LastName = '".$q."' AND Hometown = '".$q2."'"; I understand ho
  24. I'm looking for a way to display the contents of an XML file on a web page with AJAX. I rely on the w3schools "simple CD catalog application", which shows a part of the XML (author and title) and, when you click on a title, displays the details of the CD. I need, however, to be able to add sorting and filtering when displaying artist and title - it could, for instance, be sorting the titles alphabetically or apply a filter based on the year of release. XSLT doesn't seem to work with AJAX so I hope JavaScript could be the answer: Is it possible to add such functions to the application exa
  25. I'm trying to select data from a MySQL database that is hosted on a webserver. I want to be able to retrieve the data from a table within the database and then illustrate it within a HTML table. There's an example on W3Schools that I've been following, but I'm unable to retrieve the data successfully. http://www.w3schools.com/php/php_ajax_database.asp Below is the source code: (HTML) <html> <head> //Javascript code <script> function showUser(str) { if (str == "") { document.getElementById("txtHint").innerHTML = ""; return; } else { if (window.XMLHttpRequest) { // code
  • Create New...