How to process/eval $ajax response as html/javascript when loading into a jquery dialog in MVC 3? -


i have index page list of users , edit link. when click link wold open jquery dialog edit , save.

i doing ajax on view , loading return data div. return data html , javascript both. return text essentially. need javascript in return executed, sort of running eval. possible or there better way it? guess open in window.open or iframe. wondering if jquery dialog or other model dialog solution possible? there recommended way?

   $.ajax({                 type: "get",             url:  "/user/edit/" + user.id,             cache: false,             datatype: 'html',             error: function (xmlhttprequest) {                                   $("#edit-dialog").html(xmlhttprequest.responsetext);             },             success: function (data) {                 $("#edit-dialog").html(data);                                    $("#edit-dialog").dialog("open");             }                      }); 

the page edit more simple form - has reasonable amount of javascript , ui candy. thanks!

inline javascript should executed browser renders it. think problem using document.ready initialize, never fire if add html after initial page rendering. 2nd, javascript has come after html, because js not find html elements.


Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -