Luca Marzi
Luca Marzi

Reputation: 806

Ajax requests in jquery mobile dialog

I have a problem...

I'm working on a dialog in which there're two buttons that are linked with two different actions. I'd like to have two Ajax requests when the buttons are clicked. I tried every kind of javascript scripts but it dosn't work...

I premise that in the page of the dialog I haven't included jquery mobile scripts (in the guide is said that dialogs don't need links to the script if they're called as dialogs through a link [data-rel])

It seems that inside dialog external javascript code isn't loaded... This is a problem...

Do you think it's better to call the dialog with a simple link (without data-rel and with data-ajax=false) and replace data-role=page with data-role=dialog (I mean inside the dialog page).

Thank you

Best regards

Luca

Upvotes: 0

Views: 474

Answers (1)

Luca Marzi
Luca Marzi

Reputation: 806

I found the solution through Jquery mobile forum...

The problem is that for dialogs the javascript code must be wrote inside the page div and not at the end of the body (the classical position of javascript code). So your code will be loaded and will work...

Upvotes: 1

Related Questions