ajax content (post) in a jquery dialog not loading on the second loading of the dialog -


I have a page where I load a dialog on the click of a button:

 Edit the  function ShowShyDule (IMID) {$ (".ui-dialog-content"). Dialog ("off"); Var url = "inc / ajax / schedule-editShowSchedule.php? EmId =" + emId + "and station id =" +   

After that, in that dialogue, I trigger. On my drop down box. To load the infos based on the selected element.

  & lt;? Php $ emId = $ _POST ['emId']; $ StationId = $ _POST ['stationId']; ? & Gt;   

[...]

  $ (document) .ready (function () {$ ("# selectShow"). Unbind ('change' ("#SHTimelines"). Html ('N Charges'); var emId = $ ("# selectShow"). Val (); var stationId = & lt ;? php echo $ stationId;? & Gt; var params = {EmId: emId, stationId: stationId} $ .post ('inc / ajax / schedule-getAllTimelinesByEmId.php', parameter, function (data) {warning ('$ ("# ShowTimelines"). $ Html (data); $ (". Button, button, input: submit, input: button"). Button (); enabledAdvanced display (); EnableInternationalCloseBox ();}, "Html");})? Php if ($ emId & Gt; 0) {? & Gt; .change () & lt ;? php}? & Gt;;});   

For the first time, it works fine

But if I close the dialog box and click to open it again, then the alert actually works, but I see $ ("# showTimelines") HTML No look at: $ ("# ShowTimelines"). Html ('N Charges');), although I see it in Firefox and I made the document only after loading ...

Anyone knows why and / or how to fix it

And if you divide those two steps, then it should work: Once the dialog (for example on the document ready), and just call the 'Open' call on the click of the button (you still normally have to dial the internal HTML of the dialog Can update). From:

From:

A call for $ (foo) .dialog () will initialize a dialog instance and will open the dialog by default if you press a dialog If you want to reuse, then the easiest way is to disable the "auto-open" option :

 $ (foo) .dialog ({autoOpen: false}) and $ ( Foo) Open it with .dialog ('open'). To turn it off, use $ (foo) .dialog ('close')   

Comments