GSimon Posted October 20, 2011 Share Posted October 20, 2011 Hi, I downloaded this Javascript Content Editor (http://www.nicedit.com/) which works great. The only problem is I can't figure out the Ajax which would allow a user to save the div content once they are done editing. I have tried to figure this out using the help found here (http://wiki.nicedit.com/w/page/525/Saving%20via%20AJAX), and it work to an extent. But it you look at the picture below this is what happens when I click to edit the div and then hit 'Save' After I hit OK in the last part I refresh the page and everything is the same. So what part of the coding needs to change in order for me or users logged into my site to change the content then save it? Thanks, here's the code on the site from the example I posted <script> var area1, area2 function toggleArea1() { if(!area1) { area1 = new nicEditor({fullPanel : true, onSave : function(content, id, instance) { alert('save button clicked for element '+id+' = '+content); } }).panelInstance('myArea1',{hasPanel : true}); } else { area1.removeInstance('myArea1'); area1 = null; } } function addArea2() { area2 = new nicEditor({fullPanel : true}).panelInstance('myArea2'); } function removeArea2() { area2.removeInstance('myArea2'); } bkLib.onDomLoaded(function() { toggleArea1(); }); </script> <script src="/nicEdit.js" type="text/javascript"></script> <script type="text/javascript">bkLib.onDomLoaded(nicEditors.allTextAreas);</script> <br /> <div id="myArea1" style="width:500px;height:300px"> Whats Up <img src="http://www.google.ca/intl/en_ALL/images/logos/images_logo_lg.gif" /> </div> <button onClick="toggleArea1();">Toggle DIV Editor</button> [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/249495-content-editor-and-saving-page-problem/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.