Monday, 9 September 2013

Javascript is breaking when i pass php string in it, why?

Javascript is breaking when i pass php string in it, why?

Having some problems with a javascript code, when i try to pass a php
string to it, it's a date timer for counting, and it's working if i give
the static value but if i have a php string in it it gives only zeros.
<?php $r="June 7, 2087 15:03:25"; ?>
<script type="text/javascript">
$(function() {
var endDate = "<?php echo ;?>";
$('.countdown.simple').countdown({ date: endDate });
});
</script>
you can check the code right here: http://jsbin.com/EboVeCO/1/edit , if
you comment the $r and put the date exactly in the JS like it is, it will
work, else is not working :(
What's the matter? why isn't it working?
Salut!

No comments:

Post a Comment