Hi to all people :D i have a problme with method ajax for jquery, I dont know what happend xD
I am use the ajax for a confirm, it is works fine until i send the url
if (confirmation) {
$.ajax({
type: "GET",
url: "http://localhost/Bar/index.php",
dataType: "json",
data: {current: current_item, disp: disp},
success:function() {
alert( "Data Saved");
}
});
}else{
return false;
}
I already try
- Cache to false.
- With dataType jason and without it.
- Urls relative or absolute.
- Method $.get and $.post.
- Type:post
- I delete the other code and only leave alone the ajax.
I use the inspector for google chrome and the url is sended but not change or get the vars in the inspector i got this:
index.php
styles.css
jquery-1.9.1.js
jquery-ui.js
index.php?current=table_6&disp=available
but i cant obtain with get and not matter if i use method post or get my url always is index.php without variables i only can see with the inspector.
I have this for obtain the var:
if($_SERVER['REQUEST_METHOD']=='GET' && isset($_GET['current'])){*/
$pos = $_GET['current'];
echo $pos;
}
but only give me - without the comprobation for see the error:
Notice: Undefined index: current in C:\wamp\www\Bar\index.php on line 4
Call Stack
# Time Memory Function Location
1 0.0009 255448 {main}( ) ..\index.php:0
Thanks for any suggestion, regards :D