Cybervanes
asked on
JavaScript to write and execute PHP script code to a div tag
I know php is server based and only executes when the page first loads (at run time)
my question is;
Can you use JavaScript to write and execute PHP script loaded from an external file?
this is what Ive tried;
<script type="text/javascript">
function showAreaOfTown(){
var target = document.createElement( "script" );
target.setAttribute( "src", "areaOfTown.php" );
document.getElementById("a reaOfTown" ).appendCh ild( target ); //the div tag
}
</script>
my question is;
Can you use JavaScript to write and execute PHP script loaded from an external file?
this is what Ive tried;
<script type="text/javascript">
function showAreaOfTown(){
var target = document.createElement( "script" );
target.setAttribute( "src", "areaOfTown.php" );
document.getElementById("a
}
</script>
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER