What's the best way to add large html chunk (like a form and html etc.) using javascript?
Hi all,
In php - we can do and if statement something like:
<?php if ($test1 !=''){
?>
add HTML HERE
<?php
// end if here
} ?>
and the html will only show if the condition is met.
Q: So, What's the best way to add large html chunk like a form using javascript IF statement or a better way???
like this - or...???
<script>
if ( test1 !="" ){
//this....
document.getElementById('showthis').innerHTML = "large html chunk";
}
// or this....
$.get("codeblock-1.html", function(fileData){
$('put-stuff-here').html(fileData);
});
// or something better?
</script>
