Inside jQuery.html (), I want to execute the following script.
$("#row1").html("<td id="cellId"><script>if (selectedStr) {var elem = $(\"#cellId\"); $(elem).bind(\"onRefresh\", function() {loadColor(selectedStr); storeStr(selectedStr);});$(elem).trigger(\"onRefresh\");) }</script><td>")
Demand:
I had testPage.jsp which contains a table with cells. When a specific cell is selected and the submit button is pressed, a pop-up window opens. On the pop-up page, some data is modified and processed through ajax. The resulting ajax response should be dynamically tuned to the parent line. The ajax response creates all the content that needs to be installed. This is where I fail. Ajax's answer would be something like this. <td>.....<td> <td>.....<td> <td>content<script>...</script></td> <td>.....<td> <td>content<script>...</script></td> ... Also, "selectedStr" is a global javascript variable in testPage.jsp.
Problems: 1. "selectedStr is undefined" is a browser error message. I could not get a reference to the global variable. 2. Linking elements does not occur.
I tried using jQuery.getScript (), jQuery.globalEval, jQuery.eval. I could not understand the {{html}} jQuery.
Thanks!
source share