a HTML div
<div id="viz"></div>
javascript
<script type="text/javascript">
var gg=document.getElementById("viz");
function ex(nn) {
var zzz;
d3.xml("./xyzfiles/svgs/s"+nn+".svg", "image/svg+xml", function(xml) {
zzz=xml.documentElement;
});
if(q==null) {
alert("no child");
} else {
alert("has child");
}
gg.appendChild(zzz);
}
ex(1);
ex(6);
</script>
i have svg files s1.svg,s2.svg .... which are loading when i use alert() function but when i remove like below
<script type="text/javascript">
var gg=document.getElementById("viz");
function ex(nn) {
var zzz;
d3.xml("./xyzfiles/svgs/s"+nn+".svg", "image/svg+xml", function(xml) {
zzz=xml.documentElement;
});
gg.appendChild(zzz);
}
ex(1);
ex(6);
</script>
ex(1),ex(6) are not getting executed.Why it is happening sir and Is there any silent way to refresh DOM so that ex() can be executed without alert().