Newbie89 Posted November 13, 2012 Share Posted November 13, 2012 Need help... Link to comment Share on other sites More sharing options...
thescientist Posted November 13, 2012 Share Posted November 13, 2012 what's the specific problem. Do you have SQLIte installed? Link to comment Share on other sites More sharing options...
Newbie89 Posted November 14, 2012 Author Share Posted November 14, 2012 yes,SQLite was installed.I just dunno how to connect.Such as should the ajax.html and php file need to put in same directory?How to get the SQLite database through AJAX? Link to comment Share on other sites More sharing options...
thescientist Posted November 14, 2012 Share Posted November 14, 2012 (edited) have you read through the AJAX tutorials at all? Or anything on SQLite? It sounds like you haven't. I would start there. http://www.w3schools...jax/default.asphttp://php.net/manua...book.sqlite.php The only thing that sqllite will change in the entire flow is just what functions you call in PHP. Everything else will be the same as any other normal AJAX request. Honestly, from the sounds of it, I would just play around with the SQLite code you need in a normal PHP file frist till you can get the output you want. After that, then I would integrate AJAX into the mix. Edited November 14, 2012 by thescientist Link to comment Share on other sites More sharing options...
Newbie89 Posted November 15, 2012 Author Share Posted November 15, 2012 <!DOCTYPE html><html><head><script>function loadXMLDoc(){var xmlhttp;if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); }else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); }xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { document.getElementById("myDiv").innerHTML=xmlhttp.responseText; } }xmlhttp.open("GET","ajax_info.txt",true);xmlhttp.send();}</script></head><body> <div id="myDiv"><h2>Let AJAX change this text</h2></div><button type="button" onclick="loadXMLDoc()">Change Content</button> </body></html> Link to comment Share on other sites More sharing options...
Newbie89 Posted November 15, 2012 Author Share Posted November 15, 2012 ajax_info.txt AJAX is not a new programming language. AJAX is a technique for creating fast and dynamic web pages. Link to comment Share on other sites More sharing options...
Newbie89 Posted November 15, 2012 Author Share Posted November 15, 2012 I need to put this 2 file add where?I try at http://www.w3schools.com/ajax/tryit.asp?filename=tryajax_first.done!I wanna try in myself by copy them and test.So how? Link to comment Share on other sites More sharing options...
thescientist Posted November 15, 2012 Share Posted November 15, 2012 put the txt file in the same directory as the html file. You should look up how to find the error console for your browser so you can look for errors as you test your code. Link to comment Share on other sites More sharing options...
Newbie89 Posted November 16, 2012 Author Share Posted November 16, 2012 Timestamp: 11/17/2012 2:38:24 AMError: syntax errorSource File: file:///C:/Users/Hong/Desktop/hh/ajaxinfo.txtLine: 1, Column: 1Source Code:AJAX is not a new programming language. Link to comment Share on other sites More sharing options...
justsomeguy Posted November 16, 2012 Share Posted November 16, 2012 That shouldn't happen with the code you showed. That error would happen if you were trying to use that text file as a Javascript file. Link to comment Share on other sites More sharing options...
Newbie89 Posted November 17, 2012 Author Share Posted November 17, 2012 oic...so what do I need do...I'm stuck.@@ Link to comment Share on other sites More sharing options...
thescientist Posted November 18, 2012 Share Posted November 18, 2012 show us the latest code you are using. please indent, format, and use [ code [/ code ] (no spaces) tags when posting. also include the contents of the .txt file. 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