65 Comments
- pigdart, on 10/12/2007, -1/+16you should fix this to work in opera
- catoutfit, on 10/12/2007, -2/+9http://www.powerlabs.org/images/medal.jpg
- ymschaap, on 10/12/2007, -1/+6what kind of errors does it generate?
- hattan, on 10/12/2007, -1/+4You know, it's really not that hard to find a demo. I mean I wonder where the link "Example page" goes?
- prockcore, on 10/12/2007, -1/+4no it doesn't, it crashes safari if you hit enter in the first textbox.
- captainpete, on 10/12/2007, -1/+4Was it fixed for Opera? It seems to be working fine for 8.54.
- mrblack, on 10/12/2007, -1/+3read this bit then.. http://www.yvoschaap.com/instantedit/update.phps. Put your database changes in there my child.
although i just use the prototype lib... much nicer. - catoutfit, on 10/12/2007, -1/+3RTFM :)
- n0xie, on 10/12/2007, -1/+3Very nice script
- v3xt0r, on 10/12/2007, -0/+1mrblack has no clue of what I am talking about here.
- seventoes, on 10/12/2007, -1/+2Yeah this is technically just DOM editing, with AJAX if you are sending the form values to another script, but mostly just DOM...
This script is EXACTLY what i have been looking for for a script im writing too! Great job! - sporktek, on 10/12/2007, -1/+2So, how would you go about updating content stored in, say, a MySQL database with PHP+this?
- EternalNY1, on 10/12/2007, -4/+5Ok, it's been a while since I did web programming... but isn't the Document Object Model (DOM) a totally different subject than Asynchronous JavaScript and XML (AJAX)? Wouldn't AJAX be used to work with the DOM?
It just doesn't seem like "AJAX, DOM, whatever you call it" is an appropriate phrase here. - jon1012, on 10/12/2007, -0/+1Yeah it stores it in the database I've tried... very cool (and funny btw) ;)
- mpancha, on 10/12/2007, -2/+3ditto what prockcore said. I can replicate the safari crash by editing text in the first line.
- tweder, on 10/12/2007, -1/+2This crashes the latest version of Safari when you try to commit your changes. :(
- looklikecontest, on 10/12/2007, -0/+1Yeah, the example works fine in Opera 8.54. Saving might be a problem though, I know for example TiddlyWiki isn't able to save itself in Opera.
- jon1012, on 10/12/2007, -0/+1@ascheinberg:
Never use referers to verify anything, it's really easy to spoof it with firefox for example using extensions...
The good solution imho is to use https and sessions... - felix9x, on 10/12/2007, -0/+0One weakness with such approach is that there is no visual way to see which fields are editable or not you have to actually click on something to see if you can edit it. One way is around this is to add borders or some sort of way to see what can be edited in so called edit mode. Once you start going this way then the page starts looking differently from the original.
Looking at the code I see nothing is done to handle such a case if you had a link inside a field you wanted to edit. Also every time you hit enter it sends data over to the server. Seems like some excessive requesting to me. This code needs more polish. - rhbalingen, on 02/18/2008, -0/+0Hi,
just finished my own little "EditInPlace", may be someone might like it ...
http://rh-balingen.de/clip_this/eip.htm
http://rh-balingen.de/clip_this/eip.zip
( -: roland :- ) - compu73rg33k, on 10/12/2007, -1/+1Wow, when implementing it, I was trying to edit the code for my situation, and wow, it's written in spanish...
- vh1`, on 10/12/2007, -1/+1look in the example
- v3xt0r, on 10/12/2007, -2/+2hmm... If refreshing pages is 'soo 1999', then why do I have to refresh the page to see other people's changes??? eh?
Sure, it updates MY changes in real time, but I have to refresh the page to see if someone overwrote my changes, or else it just sits there.
The idea is to update MY changes, to everyone elses browser, in real time, and vice versa. Which, of coarse, is a bandwidth liability, and why we in the professional (real) world, do not use AJAX for such remedial tasks, unless of coarse we have the bandwidth to support it. =) - tweder, on 10/12/2007, -1/+1In his blog, it says this:
"Create a update file that handles the input. For example this PHP: Update File"
That's where you'd stick your SQL queries. - dwalsh, on 10/12/2007, -1/+1Interesting to note the title of his weblog is editable using this technique. Whether the change actually updates on the server-side, this I don't know.. sure seems to.
- ri59, on 10/12/2007, -0/+0Novice question, how do I get it to save the edits? I get it all to work till I hit refresh. I have no db experience and don't see any clues in his files or examples. Any help would be awesome.
- dayquil, on 10/12/2007, -1/+1This is really interesting, but in the interest of knowing what the hell is going on, an english javascript file would be even better :)
...says the undereducated American. - hattan, on 10/12/2007, -2/+2I think it stores the title in a session variable. I changed the title, then reloaded the page and it was still there.
- realmacsoftware, on 10/12/2007, -0/+0Nice example. Dugg.
- nucleocide, on 10/12/2007, -1/+1I like it, it's quite intuitive. CMS's can be confusing to our not-so-intelligent clientel.
...oops I just broke it by putting it in angle brackets... can anyone fix it so I don't feel like a dick? - maseone, on 10/12/2007, -1/+1The funny thing is, AJAX is also sorta "so 1999". lol.
- harl, on 10/12/2007, -0/+0hi, I'm not too fond of the php- and mysql-stuff at this point. I've put up some crappy mysql though and i know HTML and java, but that wasn't exactly what i was looking for. so here's my question: is there an easy solution to integrate this or a similar pre-made script into a site (or a few single pages) without using php and mysql ?
(just because it's only two or three private pages being more or less static in design and content which i want to update some small things on now and then and i want to keep it as separated as possible. most probably in a way the file might still be transportable, so no dynamic stuff.) - compu73rg33k, on 10/12/2007, -1/+1Very freaky and awesome that I was searching google for this EXACT thing. Wow I love digg.
- becos, on 10/12/2007, -0/+0Hello!
I have a question for YMSCHAAP:
But before, I would like to tell you that i really like the slick and slim sollution for updating an inline field with AJAX.
However, I saw that the update is done with PHP server side. Right now, I have a project that runs callsic ASP scripting. I wonder if you can adapt your functionality for ASP. I am not a programmer, but i tried myself as well. Of course, i couldn't make it work but, as i said, i am not a programmer.
My question is: cold you make it work with ASP that updates aMySQL database?
Thanks bunches!
Regards,
Beco - ymschaap, on 10/12/2007, -0/+0You can't come around using some script language like php to 'handle&save' the variables that are send. Please check the update.phps in the blog post. You can post your variables to a file"//this writes content to a text file" . (and eventually read it)
- inactive, on 10/12/2007, -0/+0it crashed safari for me
- ymschaap, on 10/12/2007, -0/+0You can see if a text field is editable by:
- onmouseover you get a pointer cursor
- onmouseover you get an alt text with "click to edit"
You can also have it underline the editable text parts (edit the js function highLight()) - poohneat, on 10/12/2007, -1/+1I like this [http://www.wikiwyg.net/]
Wikiwyg is the simple way to add Wysiwyg editing to your existing [anything] project. - Zjm7891, on 10/12/2007, -2/+1How bout you actually browse the site and enable javascript...
- MiddleOfNowhere, on 10/12/2007, -1/+0It does work in Opera 9.0 Beta, so maybe it was Opera who had to fix something. :)
- Pests, on 10/12/2007, -2/+1There is, about three.
- topsub, on 10/12/2007, -1/+0There is one on digg that uses a mysql Database to updated content instead of a text file
- steveodigg, on 10/12/2007, -1/+0seems to work fine with the nightly webkit (may 15th).
- topsub, on 10/12/2007, -1/+0double click the text to edit.
http://bossmanmedia.com/ajax/ - arduenn, on 10/12/2007, -3/+1(FYI - Works fine in Safari)
- cobracommander, on 10/12/2007, -4/+2If refreshing pages is 1999, I guess I'm stuck in the past.
- ascheinberg, on 10/12/2007, -3/+1Just be careful with this. Updating a database via ajax is kind of risky, because there's no referrer to test, so anyone can read the script and request it on their own. Note that cookies and session variables DO work, so you should make sure ANY page that talks to a db in any way, shape, or form is somehow protected from someone, anyone, including a bot, from requesting the page and instantiating an action.
In short: don't use AJAX except where it's appropriate. It's not a web panacea. - Sushubh, on 10/12/2007, -3/+1NetVibes is one good example...
- zerod, on 10/12/2007, -2/+0Google Analytics
- jbestrom, on 10/12/2007, -4/+2Or how about you don't put nudity in the meta-tag so people with filters can see it.
-
Show 51 - 63 of 63 discussions



What is Digg?
No big deal, vassever. Bruno is our latest guest for Digg Dialogg.