I’m using jQuery Modal.
I have two windows that are almost identical, just with a slightly different database query, so I want to repeat as little code as possible.
I was thinking the best way would be to pass an argument somehow to the ajax method so I can return different data based on it but leave everything else the same. I don’t see a way to do that..
$('#browseVideoWindow').jqm({
modal: false,
trigger: '#videoPersonalLibBtn, #videoVidLibBtn',
ajax: 'byob/components/videoBrowser.php', //pass a variable based on which the trigger is?
onLoad: function(event) {
$("#browseVideoWindow .dialogok").click(function(event) {
$('#browseVideoWindow').jqmHide();
changeVideo($('#videoBrowserSel').val());
});
}
});
is there a way to facilitate this type of behaviour?
You can add the trigger type to the query string and process it on the server:
…