rizwansyed Posted August 29, 2018 Share Posted August 29, 2018 Hi I am working on AJAX basics of post. https://www.w3schools.com/js/tryit.asp?filename=tryjs_ajax_post I have tried above example and it prints as below: This content was requested using the POST method. Requested at: 8/29/2018 7:46:26 AM How Does This gets printed? Is it getting the data from "demo_post.asp". Can anyone share the contents of "demo_post.asp" and clear understanding how it works Thanks and Regards Rizwan Syed Link to comment Share on other sites More sharing options...
dsonesuk Posted August 29, 2018 Share Posted August 29, 2018 Yes! whatever is printed on the demo_post.asp page can be returned to show result Link to comment Share on other sites More sharing options...
rizwansyed Posted August 29, 2018 Author Share Posted August 29, 2018 Hi I have loaded the same file on my PC xhttp.open("POST", "index_1.txt", true); and i have index_1.txt file in my same folder as html file. When i press the button , am not getting the content present in index_1.txt file Please suggest Link to comment Share on other sites More sharing options...
Ingolme Posted August 29, 2018 Share Posted August 29, 2018 Most browsers do not allow AJAX to work on the local filesystem by default due to security settings, it has to be from a server. You can install a test server on your computer using XAMPP or WAMP and test AJAX on the localhost domain. Link to comment Share on other sites More sharing options...
rizwansyed Posted August 30, 2018 Author Share Posted August 30, 2018 (edited) Hi 1.Now am able to run using XAMPP on PC. 2.Instead of using second argument with file name, is it possible to use as a function and call it in same file in below code xhttp.open("POST", "index_1.txt", true); 3.When i run from my board, am not getting proper data. I mean it is not fetching the file index_1.txt.html and index_1.txt file are available in same path in sd card. Anything wrong Please suggest Thanks and Regards Rizwan Syed Edited August 30, 2018 by rizwansyed Link to comment Share on other sites More sharing options...
rizwansyed Posted August 30, 2018 Author Share Posted August 30, 2018 (edited) Hi How to run ajax code in my web browser. Do i need to install a test server on board side to support it? Edited August 30, 2018 by rizwansyed Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now