![]() |
Edit-in-place
Hiya!
I'm having some troubles with a javascript. It's supposed to be like .. when you click an element that has class "editable", text should be replaced with textarea and allow you to edit the text. Right now it doesn't save it to a database or anything, I'm just trying to figure out how to accomplish this. And no - I'm not using any js framework. Looks like this: Code:
var config = {As you see I'm alerting container.childNodes[1] - which is the div element, but I can't seem to be able to remove it by container.removeChild(container.childNodes[1]); which is really weird? Also, after I've "edited" an element, it doesn't work to click on that element again to get the textarea again.. how come? If you need HTML source to be able to help, post and I will post it! Thanks |
This sounds like a cool script, I would love to see this working.
Krik might be able to help you, he helped me with some JS issues. If you can post the HTML or link, I would like to see it in action... |
Yah, I solved it. The problem that occur is called Event Bubbling.
http://www.quirksmode.org/js/events_order.html Code:
var config = {HTML Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" |
| All times are GMT. The time now is 12:11 AM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0