This my code :
<?php
if (isset($_GET["add"]))
{
?>
<script type="text/javascript" language="javascript">
var i=0;
function createDiv()
{
$('#newdiv').append('<div id="div"'+i+'" class="ex" style="text-align: left;">Life Really suck</div>');
i++;
$( ".ex" ).draggable({containment:'parent',cursor:'pointer',opacity:0.6});
$( ".ex" ).droppable();
}
createDiv(); // will execute when it loads this line
</script>
<?php
}
?>
<div id = "newdiv"> </div>
How can I make the function execute in the DIV outside of the condition statement?
I need the function execute normally is the GET["add"] is set
Now I it does not execute in the DIV even though the function does run