javascript, widgets problem!

Diese Seite verwendet Cookies. Durch die Nutzung unserer Seite erklären Sie sich damit einverstanden, dass wir Cookies setzen. Weitere Informationen

  • javascript, widgets problem!

    was stimmt hier nicht? beiss mir schon den 3ten tag die zaehne daran aus.
    "Widget1801979802OnClickFunction is not a defined function" sagt die javascript-console.

    danke euch!
    alex

    Quellcode

    1. <script type="text/javascript">
    2. function Widget468703135OnClickFunction()
    3. {
    4. var myscript = "<scr"+ "ipt>"
    5. + "type=\'text/javascript\'>"
    6. + "function Widget1801979802OnClickFunction()"
    7. + "{"
    8. + "var data='<" + "p>Hello world<" + "/p>';"
    9. + "var res= dojo.widget.byId(\'Widget1365180540\');"
    10. + "res.setContent(data);"
    11. + "}"
    12. + "</scr"+"ipt>"
    13. + "<button dojoType=\'Button\' onclick=\'Widget1801979802OnClickFunction();\' id=\'Widget1801979802\' >Widget1801979802</button>";
    14. var response= dojo.widget.byId("Widget1967513926");
    15. response.setContent(myscript);
    16. }
    17. </script>
    18. <button dojoType="Button" onclick="Widget468703135OnClickFunction();" id="Widget468703135" >Widget468703135</button>
    Alles anzeigen
  • javaScript in JavaScript?

    hm.. hab mich noch nicht in dojo eingearbeitet, aber vielleicht hilft dir
    executeScripts=true


    http://dojotoolkit.org/pipermail/dojo-interest/2006-May/009309.html
    I think it's executeScripts=true. Please check the tests in the test
    directory for examples of this.

    Scott O'Reilly wrote:
    > I am grabbing a chunk of HTML from the server and displaying it in a
    > content pane with ContentPane.setContent(data). The problem is that the
    > HTML contains contextually sensitive JavaScript that isn't being
    > evaluated. For example, if the server returned the following code
    > (displayed below), it would display the text, but not a javascript
    > popup. Is there a way to force this evaluation?
    >
    > -Scott
    >
    > <p>This is before the alert</p>
    > <script type="text/javascript">
    > alert('this alert text is never displayed');
    > </script>
    > <p>This is after the alert</p>