I have this ajax code for getting the current selection, so I can later call database with php GET. Firebug error:
Missing ) after argument list -“success”:function(data){
Any ideas?
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#select").change(function(){
$.ajax(
"file.php?selected=" + $(this).val(),
"success":function(data){
$("#results").html(data);
}
)
})
});
</script>
<select id="select">
<option> something </option>
<option> something2 </option>
<option> something3 </option>
</select>
<?php
//echo $_GET['selected'];
?>
<div id="results"></div>
You’re missing the ‘url’ property name before
"file.php?selected=" + $(this).val(),: