473,594 Members | 2,692 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Create a wiki website where you can edit and save content

2 New Member
Hi,

I'm trying to create a site very similar to wiki, where you can edit, save.. Generally update data for the future use... This particular program I wanna do it using javascripts...

Please help me out in getting into the solution for the same...


Sample prg which I hve done is as below... Looking forward for all of your help...Thanks in advance

Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <head>
  3. </head>
  4. <body>
  5.  
  6. <!--<script src="Editting.js">
  7. </script>-->
  8.  
  9. <SCRIPT TYPE=text/javascript>
  10.  
  11. var editing  = false;
  12.  
  13. if (document.getElementById && document.createElement) {
  14.     var butt = document.createElement('BUTTON');
  15.     var buttext = document.createTextNode('Save!');
  16.     butt.appendChild(buttext);
  17.     butt.onclick = saveEdit;
  18. }
  19.  
  20. function catchIt(e) {
  21.     if (editing) return;
  22.     if (!document.getElementById || !document.createElement) return;
  23.     if (!e) var obj = window.event.srcElement;
  24.     else var obj = e.target;
  25.     while (obj.nodeType != 1) {
  26.         obj = obj.parentNode;
  27.     }
  28.     if (obj.tagName == 'TEXTAREA' || obj.tagName == 'A') return;
  29.     while (obj.nodeName != 'P' && obj.nodeName != 'HTML') {
  30.         obj = obj.parentNode;
  31.     }
  32.     if (obj.nodeName == 'HTML') return;
  33.     var x = obj.innerHTML;
  34.     var y = document.createElement('TEXTAREA');
  35.     var z = obj.parentNode;
  36.     z.insertBefore(y,obj);
  37.     z.insertBefore(butt,obj);
  38.     //z.removeChild(obj);
  39.     y.value = x;
  40.     y.focus();
  41.     editing = true;
  42. }
  43.  
  44. function saveEdit() {
  45.     var area = document.getElementsByTagName('TEXTAREA')[0];
  46.     var y = document.createElement('P');
  47.     var z = area.parentNode;
  48.     y.innerHTML = area.value;
  49.     z.insertBefore(y,area);
  50.     z.removeChild(area);
  51.     z.removeChild(document.getElementsByTagName('button')[0]);
  52.     editing = false;
  53. }
  54.  
  55. document.onclick = catchIt;
  56.  
  57.  
  58.  
  59. </script>
  60.  
  61. <p>
  62. The actual script is in an external script file called "xxx.js".
  63. </p>
  64.  
  65. <input type="button" value="Edit" onClick="catchIt(e)">
  66. <input type="button" value="Save" onclick="saveEdit()">
  67. <input type="button" value="Ready">
  68.  
  69. </body>
  70. </html>
Sep 3 '07 #1
2 2453
dmjpro
2,476 Top Contributor
Welcome to TSDN!
Actually what problem you are facing, please mention this.
Then I will be able to do solve your problem.

Kind regards,
Dmjpro.
Sep 4 '07 #2
acoder
16,027 Recognized Expert Moderator MVP
Changed the thread title to better describe the problem.
Sep 4 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
1305
by: Rootshell | last post by:
I need to create the table and I want to edit its content from www level. Here is some example: http://www.rootshell.be/~flash44 There is a table. Is there possibilty to edit the content using <input> command?
2
1503
by: Robert Brewer | last post by:
Cross-posted here to encourage comments/discussion. I know there's a big feature or two I'm missing out on ;) Suggestions welcome. Tibia is an in-browser editor for web pages. It allows you to quickly and easily modify the content of your web pages. It allows you to directly view, edit, and save files on your webserver. It also allows you to upload files from your local filesystem to your webserver, and then edit those documents. It also...
4
40415
by: ferg | last post by:
I've checked all the FAQs and help - spent a couple of hours on this now and it's really bugging me. I've got Moin 1.3.5 installed on IIS 5.0. I can view and edit pages without any problems, but cannot create new pages - either trough the GUI, or by creating a new WikiName and clicking on it. I'm stumped as to whether this is a Moin ACL problem (played around a lot with this, but to no avail) or perhaps an IIS config problem (though...
302
18440
by: Lee | last post by:
Hi Whenever I use the gets() function, the gnu c compiler gives a warning that it is dangerous to use gets(). Is this due to the possibility of array overflow? Is it correct that the program flow can be altered by giving some specific calculated inputs to gets()? How could anyone do so once the executable binary have been generated? I have heard many of the security problems and other bugs are due to array overflows.
6
2043
by: Peter.H.M.Brooks | last post by:
I'm looking for a good (ideally free), system for quite a big writing job. There will be some collaboration, but it is mainly on one system. I am keen to have easy to use indexing and cross-referencing as well as excellent backup and recovery of data. I've looked at a few wiki systems and they seem quite good, but don't support all that much formatting. I know things must have changed a lot in the last couple of years since I last...
11
4074
by: raylopez99 | last post by:
Keep in mind this is my first compiled SQL program Stored Procedure (SP), copied from a book by Frasier Visual C++.NET in Visual Studio 2005 (Chap12). So far, so theory, except for one bug (feature?) below. At some point I'm sure I'll be able to laugh about this, akin to forgeting a semi-colon in C/C++, but right now it's frustrating (time to sleep on it for a while). Problem-- For some reason I get the error when trying to save files...
16
3859
by: Mich | last post by:
Hi, i'm building an web application for anonymous users. They can take a look in the website, nothing more. In order to perform other actions, the anonymous user must be logged. So i create an aspx page with the CreateUserWizard control. The user can fill his username, password etc .... My problem is: when an user fills everything and clicks on button "create an account", nothing happens (no error, but no user account created). I...
15
5260
by: lxyone | last post by:
Using a flat file containing table names, fields, values whats the best way of creating html pages? I want control over the html pages ie 1. layout 2. what data to show 3. what controls to show - text boxes, input boxes, buttons, hyperlinks ie the usual. The data is not obtained directly from a database.
0
7947
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7880
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8010
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8242
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5413
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3903
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2389
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1486
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1217
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.