Javascript içine php koymak nasıl?

0 Cevap php

I've tried (but its not working):

<?php  
  $htmlString= 'testing';
?>
<html>
  <body>
    <script type="text/javascript">  
      var htmlString=<?php echo $htmlString; ?>;
      alert(htmlString);
    </script>
  </body>
</html>

İşte bu amaçla kullandım tutorial olduğunu:

Thanks

0 Cevap