Jump to content
php.lv forumi

jquery + php


FT3

Recommended Posts

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 by FT3
Link to comment
Share on other sites

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 by briedis
Link to comment
Share on other sites

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>

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...