[eluser]edwin87[/eluser]
Hello CI,
For my work i need to figure out if AJAX libraries like: Prototype or jQuery work with CodeIgnitor.
I'm trying to implement Prototype to a standard form.
In the header i have the following code:
Code:
[removed]
window.onload = function(){
// This 'observes' our form submit - sort of like onsubmit
$('my_form').observe('submit', function(evt) {
// Stop the actual event from happening
evt.stop();
// This is the url we submit to - change it as needed
var url = 'http://localhost/ajax/index.php/pages/id/3/edit/3';
//This will be the div we update, in our case it's form_wrapper
var container_div = $('content');
// Grab all the info in the form
var form_data = $('my_form').serialize();
// Here we make the request
new Ajax.Request(url, {
method: 'post',
parameters: form_data,
onCreate: function() {
container_div.update('Loading....');
},
onSuccess: function(transport) {
container_div.update(transport.responseText);
}
},true);
});
}
[removed]
It works realy good. But, when i submit the page, the responseText is the whole website instead he's only showing the form in the content div.
How can i solve this problem?
I've searched the whole forum but can't find any suggestions.
Also i'm curious in what type ajax librarie's you are using, and why.
Maybe can somebody help me here?
I'm using also HMVC if it makes a difference.