I have a page which has a series of dynamic jquery ui dialogs which have different id’s. For example:
<div id="message-1">
content
</div>
<div id="message-2">
content
</div>
I want some code that can launch the appropriate dialog box based on URL.
For example, if the url was http://url.com/#message-2 it would open only the appropriate dialog box.
I’ve been trying to use code like the following as a basis to start from, but it clearly isn’t a solution.
if(window.location.href.indexOf('#message') != -1) {
$('.dialog').dialog('open');
}
Any help will be greatly appreciated.
I think you are looking for this