dc_jt Posted February 6, 2008 Share Posted February 6, 2008 Hi Can someone explain to me why this wont work please?: echo '<img id="1" class="items" src="../assets/images/cookie.gif" />'; echo '<script type="text/javascript">'; echo '//<![CDATA['; echo 'new Draggable("1", {revert:\'true\'})'; echo '//]]>'; echo '</script>'; Thanks Link to comment https://forums.phpfreaks.com/topic/89731-solved-problem-with-javascriptphp/ Share on other sites More sharing options...
craygo Posted February 6, 2008 Share Posted February 6, 2008 You may have to put things on new line especially if you have comment in your code. <?php echo "<img id=\"1\" class=\"items\" src=\"../assets/images/cookie.gif\" />\n"; echo " <script type=\"text/javascript\">\n"; echo "//<![CDATA[\n"; echo "new Draggable(\"1\", {revert:'true'})\n"; echo "//]]>\n"; echo "</script>\n"; ?> Ray Link to comment https://forums.phpfreaks.com/topic/89731-solved-problem-with-javascriptphp/#findComment-459823 Share on other sites More sharing options...
dc_jt Posted February 6, 2008 Author Share Posted February 6, 2008 Thanks very much that worked great Link to comment https://forums.phpfreaks.com/topic/89731-solved-problem-with-javascriptphp/#findComment-459824 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.