In a JSP file, I have the following line:
<script type="text/javascript" src="//maps.googleapis.com/maps/api/js?sensor=false"></script>
Is there a way to only do that line if a JS variable (XY.isChina) is false?
Perhaps, can I do something like this with nesting?
<script>
if (XY.isChina === false) {
<script type="text/javascript" src="//maps.googleapis.com/maps/api/js?sensor=false"></script>
}
</script>
I thought perhaps I could do something like this:
<script>
type="text/javascript"
src="//maps.googleapis.com/maps/api/js?sensor=false"
</script>
But that seems to not work. Because then I could have just gone to:
<script>
if (XY.isChina === false) {
type="text/javascript"
src="//maps.googleapis.com/maps/api/js?sensor=false"
}
</script>
Does anyone know the correct way to do that?