FT3 Posted August 31, 2011 Report Share Posted August 31, 2011 (edited) Labdien es nekad nebiju nodarbojies ar jqurijiem , man nekadigi nesanak izvest tekstu aa ieks php if , vai kads nevaretu palidzet ? <script type="text/javascript" src="http://code.jquery.com/jquery-1.4.2.min.js"></script> <script type="text/javascript"> var settimmer = 0; $(function(){ window.setInterval(function() { var timeCounter = $("b[id=show-time]").html(); var updateTime = eval(timeCounter)- eval(1); $("b[id=show-time]").html(updateTime); if(updateTime == 0){ document.write ("test"); } }, 1000); }); </script> <div id="my-timer"> Page Will Redirect with in <b id="show-time">10</b> seconds </div> <?php $one = '<script>updateTime</script>'; $two = '0'; if($one == $two) { echo "aa"; } ?> vai nu kautka citadak apvienot jquery ar php ^_^ Paldies iepriekš Edited August 31, 2011 by FT3 Quote Link to comment Share on other sites More sharing options...
briedis Posted August 31, 2011 Report Share Posted August 31, 2011 (edited) Ak jel, tev jāsaprot, ka Javascript ir valoda, kas izpildās uz klienta datora, bet PHP izpildās uz servera. Serveris izpilda php skriptu, viss ko tas izvada (HTML, javascript) tiek nodots lietotāja pārlūka, kurš tad tālāk arī izpilda JS kodu, parāda HTML. Edited August 31, 2011 by briedis Quote Link to comment Share on other sites More sharing options...
FT3 Posted August 31, 2011 Author Report Share Posted August 31, 2011 ar php ifu var kautka apvienot ? Quote Link to comment Share on other sites More sharing options...
briedis Posted August 31, 2011 Report Share Posted August 31, 2011 Variants ir AJAX. Google it. Quote Link to comment Share on other sites More sharing options...
FT3 Posted August 31, 2011 Author Report Share Posted August 31, 2011 jau ustaisiju bet citadak izmantojot <script type="text/javascript" src="http://code.jquery.com/jquery-1.4.2.min.js"></script> <script type="text/javascript"> var auto_refresh = setInterval(function(){ $("#update").load('mysqlupdate.php').fadeIn("slow"); }, 30000); </script> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.