I have this html code:
<html>
<head>
... // call jquery etc //
<script src="dialog.js"></script>
...
<script type="text/javascript">
openmydialog(); // open dialog defined with jquery in dialog.js //
</script>
</head>
<body>
...
<div id="my-div"> Text </div>
...
</body>
</html>
well, all work correctly. I have only a problem. How I can export the:
<div id="my-div"> Text </div>
in dialog.js and to do that work correctly? I have tried defining a variable, writing something like:
var myvar = '<div id="my-div"> Text </div>';
$("#my-div").html(myvar);
but did not worked. I have tried too with document.write but same. Any solution for it?