I'm actually trying to do a dynamic administration about teams in my project. It means for example, the user has 3 buttons. Each buttons calls a function from a controller that displays a form.
However, when the form appears, the url is wierd when i press submit.
function ajax_get(){
var uri_segment = "<?=$this->uri->segment(3);?>";
$('#editTeam').click(function (e) {
e.preventDefault();
$.ajax({
type : "GET",
async : false,
url : "<?=base_url().'ajax/team/get_editTeam/';?>"+uri_segment,
dataType : "html",
success : function(data){
window.setTimeout(function () {
$('#divPage').html(data);
}, 300);
}
});
return false;
});
This function display a view in a div, and then i have a form
function ajax_editTeam()
{
$('form').submit(function(e){
e.preventDefault();
$.ajax({
type : "POST",
async : false,
url : "www.google.fr",
data : $(this).serializeArray(),
dataType : 'json',
success : function(data)
{
}
});
return false;
});
}
For this form I have another ajax call that save the field and update the team informations. As you can see I wrote 'www.google.fr' as url but it changes nothing
When I submit the form, I have a wierd url in firebug.
This is the console from firebug :
GET http://fresh-league.com/ajax/team/get_editTeam/30 200 OK 164ms
POST http://fresh-league.com/ajax/team/editTeamget_editTeam 404 Not Found 354ms
Can you please tell me why I have another requested url than www.google.fr ?
Thanks for answers Matt