should give you all the info you need. Look at Add a dynamic Save function: and Retrieving an Editor Instance -> GetXHTML( formatted ) then just do the AJAX bits... I would use jQuery for this, have a look at http://docs.jquery.com/Ajax/jQuery.post#urldatacallbacktype...but, and a BIG BUT, make sure that you do proper validation before saving the information on that page. People can call the page directly, or from another domain and alter (hack) the data. Put some Xscripting protection in there as well as user validation...
Here is code that will get you started on jQuery. If you cannot get this working, post again and I will get PHP up and running and see if I can help you more...but do try hard first though
<script src="jquery-1.2.6.pack.js" type="text/javascript"></script>
<script type="text/javascript">
function Set_Content() {
//** SEE http://docs.jquery.com/Ajax
$.ajax({
url: "pages.php", //page to call
type: "GET",//GET or POST
data: ({ page: 0, SOMEOTHER:"SOME VALUE" }),//PARAMS TO PASS TO PAGE
dataType: "html",//type of data expected back
success: function(msg) { //function to execute on success
$("#Content_Id").html(msg);//sets the html (document.getelementbyid('Content_Id').innerhtml)
},
error: function(msg) {//function to execute on errors
$("#Content_Id").html(""); //sets the html (document.getelementbyid('Content_Id').innerhtml)
}
});
}
$(document).ready(function() {//registes all these when the page has loaded an dom is ready
//** SEE http://docs.jquery.com/Ajax -> AJAX EVENTS
//whenever ajax starts
$("#loading").ajaxStart(function() {
$(this).html("Loading ..." + "<img src=\"image/loader.gif\" />");
});
//whenever ajax succeeds
$("#loading").ajaxSuccess(function(evt, request, settings) {
$(this).html(""); //there is a way to clear it, think .clear()
});
//whenever ajax errors
$("#loading").ajaxError(function(event, request, settings) {
$(this).append("Error requesting page " + settings.url);
});
});
</script>
Re: save fckeditor data with ajax
should give you all the info you need.
Look at Add a dynamic Save function: and Retrieving an Editor Instance -> GetXHTML( formatted ) then just do the AJAX bits...
I would use jQuery for this, have a look at http://docs.jquery.com/Ajax/jQuery.post#urldatacallbacktype...but, and a BIG BUT, make sure that you do proper validation before saving the information on that page. People can call the page directly, or from another domain and alter (hack) the data. Put some Xscripting protection in there as well as user validation...
Re: save fckeditor data with ajax
Thanks!
Help me for this code:
index.php
Re: save fckeditor data with ajax
I am sorry but I am not a PHP programmer.
Here is code that will get you started on jQuery. If you cannot get this working, post again and I will get PHP up and running and see if I can help you more...but do try hard first though