Connecting Tech Pros Worldwide Forums | Help | Site Map

Javascript Application Help with writing text file

Newbie
 
Join Date: Jul 2007
Posts: 18
#1: Jul 10 '07
I wanna know how its possible to clone this website. www.writesomething.net

I just want the actual programming code and files. I'm going to ceate a fully interactive website for users to input text and it appears directly on to the page without refreshing.


I can't seem to find the txt file.

[HTML]<html>
<head>
<title>WriteSomething v2</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="/css/screen_en_US.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="/js/frontend.js"></script>
<script type="text/javascript" src="/js/browser.js"></script>
<script type="text/javascript" src="/js/floating.js"></script>
</head>
<body onload="initFloaters(); document.form1.tekst.focus(); window.scrollBy(0, window.innerHeight);" onpaste="return false;">
<a id="top">&nbsp;</a>
<div id="floater1Div">
<div class="home">&nbsp;<a href="/">home</a></div>
<div class="about">&nbsp;<a href="/about">about</a></div>
<div class="about">&nbsp;<a href="/press">press</a></div>
<div class="hrvatski">&nbsp;<a href="/lang.php?lang=hr_HR">hrvatski</a></div>
<div class="hrvatski">&nbsp;<a target="_blank" href="http://www.skarabej.com/english/">by skarabej</a></div>
</div><form method="post" action="" name="form1">
<div class="text">
</span>
I wish he'd call... or that I had the balls to call him
<span class='siva'>
i'm such a noob.
</span>
Test
<span class='siva'>
<a id="end">&nbsp;</a><br />
<textarea name="tekst" onpaste="onPasteHandler()" oncontextmenu="setContextMenuSelection()" oninput="onPasteInputHandler(event)" onchange="textarea_size()" onkeypress="onPasteKeyPressHandler(event); textarea_size();" rows="5" id="tekst" onkeydown="txtarea_clear()" onclick="txtarea_clear()" class="area">write what ever you want, quick and without thinking.</textarea>
<table width="100%">
<tr>
<td align="left" width="33%"><a style="border: none;" href="#top"><img border="0" src="/images/gototop.jpg" width="50" height="76"></a></td>
<td align="center" width="33%">&nbsp;</td>
<td align="right" width="33%"><input type="image" src="/images/publish.gif" id="submit" name="submit" width="89" height="30"></td>
</script>
</body>
</html>[/HTML]

Newbie
 
Join Date: Jul 2007
Posts: 18
#2: Jul 10 '07

re: Javascript Application Help with writing text file


Can anyone help me with this?
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,581
#3: Jul 11 '07

re: Javascript Application Help with writing text file


Quote:

Originally Posted by NYXX

I can't seem to find the txt file.

What text file are you looking for?
Newbie
 
Join Date: Jul 2007
Posts: 18
#4: Jul 11 '07

re: Javascript Application Help with writing text file


The flatfile database.

I uploaded this code along with the css and js codes but i still can't seem to publish the text instantly
Newbie
 
Join Date: Jul 2007
Posts: 18
#5: Jul 12 '07

re: Javascript Application Help with writing text file


how would i go about cloning this what am i missing
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,581
#6: Jul 12 '07

re: Javascript Application Help with writing text file


You could use Ajax for this purpose. It takes the input and sends the request to the server-side script which updates the database. The callback function can update the page once it has been added.
Newbie
 
Join Date: Jul 2007
Posts: 18
#7: Jul 12 '07

re: Javascript Application Help with writing text file


Where can I find that information?
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,581
#8: Jul 13 '07

re: Javascript Application Help with writing text file


See the Ajax tutorial links in the Offsite Links thread.
Newbie
 
Join Date: Jul 2007
Posts: 18
#9: Jul 13 '07

re: Javascript Application Help with writing text file


So How would i go about clioning this website www.writesomething.net

I have the exact code he is using.

I have these files

The Javascript
Css
images which I will be changing

Now I'm missing the html file and the external file where all the text is being written to
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,581
#10: Jul 14 '07

re: Javascript Application Help with writing text file


Have you checked the tutorials? It is not that difficult. You will need a server-side language and preferably a database, though you could use a text file if you want.

Which server-side language (e.g. PHP, ASP, JSP, Perl, Coldfusion) do you know?
Newbie
 
Join Date: Jul 2007
Posts: 18
#11: Jul 14 '07

re: Javascript Application Help with writing text file


I know PHP

I'm actually lost I tried following the tutorial. Couldn't get it to work.

I would like to use a text file.
Newbie
 
Join Date: Jul 2007
Posts: 18
#12: Jul 15 '07

re: Javascript Application Help with writing text file


Quote:

Originally Posted by NYXX

I know PHP

I'm actually lost I tried following the tutorial. Couldn't get it to work.

I would like to use a text file.

Can anyone help,

I'm willing to pay if someone can build a clone
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,581
#13: Jul 17 '07

re: Javascript Application Help with writing text file


Show what code you have or what attempt you have made.

I assume you know PHP and can create a text file from the posted input using $_POST. If not, you should check in the PHP forum or start a new thread there for that particular sub-problem.

There is more than one possible way to solve this, but this is one way. Use AJAX to make a request to the PHP file with the input from the textarea. This is added to the text file. Now we could return the whole text file all over again, but that could be huge. The alternative is to just update the page by adding to the end of the data, but if someone in the meantime had added something, this would not display. It depends on how accurate you wish to be.

One other choice is whether you wish to load the content after the page has loaded or as part of the page load (i.e. a PHP page which just displays the data).

If you have a problem with your Ajax script, post it here.
Newbie
 
Join Date: Jul 2007
Posts: 18
#14: Jul 17 '07

re: Javascript Application Help with writing text file


The problem is I don't know how create an ajax script, or a text file, thats where I'm having trouble.

Also I would like to users data to be displayed even on a page load if not shown automatically, I was hoping to se the user above post as well.
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,581
#15: Jul 18 '07

re: Javascript Application Help with writing text file


Quote:

Originally Posted by NYXX

The problem is I don't know how create an ajax script, or a text file, thats where I'm having trouble.

The text file you would create on the server-side using PHP.

Show me your Ajax script. There are plenty of examples in the tutorials. There's also an example in the articles section - see this article.
Quote:

Originally Posted by NYXX

Also I would like to users data to be displayed even on a page load if not shown automatically, I was hoping to se the user above post as well.

Not sure what you mean by this.
Newbie
 
Join Date: Jul 2007
Posts: 18
#16: Jul 22 '07

re: Javascript Application Help with writing text file


Pretty in simple terms I want to make a website like this one just with a different CSS template.

www.writesomething.et
volectricity's Avatar
Expert
 
Join Date: Jun 2007
Location: Baltimore
Posts: 587
#17: Jul 23 '07

re: Javascript Application Help with writing text file


Then do it and stop asking questions. It's nothing but databasing, form processing, and a complete lack of moderation.

I apologize if I sound annoyed (which I am), but you don't seem to be trying at all.
Newbie
 
Join Date: Jul 2007
Posts: 18
#18: Jul 23 '07

re: Javascript Application Help with writing text file


Like I said I ahve the design complete the javascript files in place. i can't actually write the script. thats where I'm having trouble. this is my current site

http://www.nyxxunderground.com/ICPAD/
Reply