johna100 Posted June 20, 2006 Share Posted June 20, 2006 Alright, someday i want to be able to make a Forum in JS but right now im starting w/ the basics i want to know how to create a simple guestbook in JS (no online editors, I want to know with pure code). This guestbook i want to have a name box, a message box and a submit button. I also want to have all the posts displayed below. Can anyone help me? Link to comment Share on other sites More sharing options...
skym Posted June 20, 2006 Share Posted June 20, 2006 I doubt you will be able to make these in JS, especially the forum, since the data must be stored on the server, so you will need a server-side language and databases. Link to comment Share on other sites More sharing options...
Chocolate570 Posted June 20, 2006 Share Posted June 20, 2006 To make such a script, you would have to use the help of AJAX and PHP/ASP. There's no possible way to just do the whole thing with javascript. Link to comment Share on other sites More sharing options...
Little Goat Posted June 20, 2006 Share Posted June 20, 2006 actually, couldn't he just use AJAX to open a text file, and then display the contents? Link to comment Share on other sites More sharing options...
aspnetguy Posted June 20, 2006 Share Posted June 20, 2006 actually, couldn't he just use AJAX to open a text file, and then display the contents?<{POST_SNAPBACK}> Yes, but AJAX is more than JavaScript, it requires PHP or ASP code aswell, which is serverside. Link to comment Share on other sites More sharing options...
johna100 Posted June 20, 2006 Author Share Posted June 20, 2006 alright now i understand how to do it better but Can some one explain in detail how to do it. If you could please post. Link to comment Share on other sites More sharing options...
pulpfiction Posted June 20, 2006 Share Posted June 20, 2006 This is a very simple one is ASP, which uses a txt file to save the messages. Jus to get some idea....http://www.asp101.com/samples/viewasp.asp?...guestbook%2Easp Link to comment Share on other sites More sharing options...
Little Goat Posted June 20, 2006 Share Posted June 20, 2006 Here is something in javascript to load a file and store it in a variable, after which you can do whatever you want with it. I don't know about the writing though. (this was revised from dynamicdrive.com's ajax include) <script type="text/javascript">/************************************************ Ajax Includes script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)* This notice MUST stay intact for legal use* Visit Dynamic Drive at [url="http://www.dynamicdrive.com/"]http://www.dynamicdrive.com/[/url] for full source code***********************************************///To include a page, invoke ajaxinclude("afile.htm") in the BODY of page//Included file MUST be from the same domain as the page displaying it.var rootdomain="http://"+window.location.hostnamefunction ajaxinclude(url) {var page_request = falseif (window.XMLHttpRequest) // if Mozilla, Safari etcpage_request = new XMLHttpRequest()else if (window.ActiveXObject){ // if IEtry {page_request = new ActiveXObject("Msxml2.XMLHTTP")} catch (e){try{page_request = new ActiveXObject("Microsoft.XMLHTTP")}catch (e){}}}elsereturn falsepage_request.open('GET', url, false) //get page synchronously page_request.send(null)content=writecontent(page_request)return content;}function writecontent(page_request){if (window.location.href.indexOf("http")==-1 || page_request.status==200)return(page_request.responseText);}</script> Link to comment Share on other sites More sharing options...
johna100 Posted June 20, 2006 Author Share Posted June 20, 2006 Thanks you guys, this is gonna make it so much eayer to create my own now that i have some examples. This is so ausome!!!!!!!!!.....yup... 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