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 -
<html>
-
<head>
-
</head>
-
<body>
-
-
<!--<script src="Editting.js">
-
</script>-->
-
-
<SCRIPT TYPE=text/javascript>
-
-
var editing = false;
-
-
if (document.getElementById && document.createElement) {
-
var butt = document.createElement('BUTTON');
-
var buttext = document.createTextNode('Save!');
-
butt.appendChild(buttext);
-
butt.onclick = saveEdit;
-
}
-
-
function catchIt(e) {
-
if (editing) return;
-
if (!document.getElementById || !document.createElement) return;
-
if (!e) var obj = window.event.srcElement;
-
else var obj = e.target;
-
while (obj.nodeType != 1) {
-
obj = obj.parentNode;
-
}
-
if (obj.tagName == 'TEXTAREA' || obj.tagName == 'A') return;
-
while (obj.nodeName != 'P' && obj.nodeName != 'HTML') {
-
obj = obj.parentNode;
-
}
-
if (obj.nodeName == 'HTML') return;
-
var x = obj.innerHTML;
-
var y = document.createElement('TEXTAREA');
-
var z = obj.parentNode;
-
z.insertBefore(y,obj);
-
z.insertBefore(butt,obj);
-
//z.removeChild(obj);
-
y.value = x;
-
y.focus();
-
editing = true;
-
}
-
-
function saveEdit() {
-
var area = document.getElementsByTagName('TEXTAREA')[0];
-
var y = document.createElement('P');
-
var z = area.parentNode;
-
y.innerHTML = area.value;
-
z.insertBefore(y,area);
-
z.removeChild(area);
-
z.removeChild(document.getElementsByTagName('button')[0]);
-
editing = false;
-
}
-
-
document.onclick = catchIt;
-
-
-
-
</script>
-
-
<p>
-
The actual script is in an external script file called "xxx.js".
-
</p>
-
-
<input type="button" value="Edit" onClick="catchIt(e)">
-
<input type="button" value="Save" onclick="saveEdit()">
-
<input type="button" value="Ready">
-
-
</body>
-
</html>
2 2453
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.
acoder 16,027
Recognized Expert Moderator MVP
Changed the thread title to better describe the problem.
Sign in to post your reply or Sign up for a free account.
Similar topics |
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?
|
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...
|
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...
|
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.
|
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...
| |
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...
|
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...
|
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.
|
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...
|
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,...
|
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,...
| |
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...
|
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();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
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...
| |