Jump to content

Is there anyway to do this?


ballhogjoni

Recommended Posts

Exactly that's why it will work, try it, i admit that one might not work. But this one will

<?php
$var = "test, proving you wrong";
echo "<script>alert('".$var."');</script>";
?>

 

Unless he is trying to do something to make php interact with the JS after the page has loaded, but he didn't say he did. If you do then look at ajax.

Not sure why this is in the PHP section, but I am pretty sure you can do the toString in javascript.

 

<Script type="text/javascript">
var myfriends=new Array("John", "Bob", "Sue")
alert(myfriends.toString());
</script>

 

from http://www.javascriptkit.com/jsref/arrays.shtml

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.