I am using a plugin for a dropdown that prevents me from using change() to find when a dropdown option is selected. How would I do the same with select() which it supports?
I currently have:
<select id="dropdown" name="dropdown">
<option value="0" data-imagesrc="images/icons/all.png">All Questions</option>
<option value="1" id="friends" data-imagesrc="images/icons/friends.png">Friends</option>
<option value="2" data-imagesrc="images/icons/friends_of_friends.png">Friends of Friends</option>
<option value="3" data-imagesrc="images/icons/network.png"><?php echo $network; ?></option>
<option value="4" data-imagesrc="images/icons/location.png"><?php echo $location ?></option>
</select>
<script type="text/javascript">
$('#dropdown').ddslick({
showSelectedHTML: false
});
$(document).ready(function() {
$('#dropdown').select(function() {
var blah = selected dropdown // mock code
$.ajax({
type: "POST",
url: "data.php",
data: {'data': blah},
success: function(data) {
$('#questions_body').hide().html(data).fadeIn('500');
},
dataType: "HTML"
});
});
});
</script>
I don’t think the select() method has anything to do with this. From the plugin page, though:
onSelected: Callback function when an option is selected in the drop down. See demo 3 above.