Thursday, 26 January 2012

Forget AJAX

Okay, turns out I DO NOT need AJAX. I took one look at it, got slightly intimidated and decided to do more research
http://www.hotscripts.com/forums/javascript/39278-php-inside-javascript.html
This says that I can simply do this...
<script>
function msg1(){alert("<?PHP echo $message1 ?>");}
function msg2(){alert("<?PHP echo $message2 ?>");}
function msg3(){alert("<?PHP echo $message3 ?>");}
function msg4(){alert("<?PHP echo $message4 ?>");}
</script>

Like just put "<?PHP ?>" tags into it. Well that simplifies things.

No comments:

Post a Comment