Php inside javascript function
- by jasminder
What i am trying to do is inside script tags run javascript inside the php loops.
For example:
<script>
$('#mydiv').mouseover(function(){
time();
function time(){
<?php
$secs = 45;
$secs--;
if($secs <= 25){
?>//javascript code here
}
});
</script>
My main purpose is when the user mouseover a div, a javascript function runs and inside that javascript function there is php if conitions. If the time is less then 25 then do a specified javascript code. then another condition if the time is less that 10 then do another javascript function.Any type of help will be appreciated. THanks