Reducing global variables and maintaining function flow
问题 Javascript is not my first language of choice, nor is it one I am all that well versed in. Functional stuff fine, objects, not so much. I am looking to see if anyone can suggest options for dealing with the following scenario. function postcodeEntry(destination,postcode) { "use strict"; document.getElementById('googlemappostcode').innerHTML = <?php if ($_GET['page']==="fun") echo "<div id=\"map\"></div>' + ";?>'<form id="postcodeEntry" method="post" action="/" onsubmit="calcRoute(\'driving\'