Welcome Guest, Not a member yet? Register   Sign In
how ajax in codeigniter ?
#1

[eluser]Unknown[/eluser]
Quote:< script >
$(document).ready(function() {

$('#myForm').submit(function() {
$.ajax({
type: 'POST',
url: $(this).attr('action'),
data: $(this).serialize(),
success: function(data) {
$('#result').html(data);
}
})
return false;
});


})
< / script >
&lt;form id="myForm" method="post" action="xxx"&gt;

&lt;/form&gt;
<div id="result"></div>

i want action of "myForm" linked to another IP.
example : My IP : 192.168.1.1
i want the action linked to 192.168.1.2

it works if i dont't use this ajax / jquery.
I added ajax code because i wanted the action of this form refered to
<div id="result"></div>, but it didn't work, why was that??, any idea?




Theme © iAndrew 2016 - Forum software by © MyBB