Witam serdecznie.
Prosił bym o podpowiedzi co zrobić by zapytanie do bazy danych zostało wykonane dopiero po upływie np 10 sekund od załadowania się strony?
<script type="text/javascript"> setTimeout ( "doSomething()", 5000 ); function doSomething ( ) { <?php ?> } </script>
function call() { $.get("response.php", function(data) { alert("Request sent"); }); window.setTimeout("call();", 10000); }
function call() { $.get("response.php", function(data) { alert("Request sent"); }); window.setTimeout("call();", 10000); }
<?php ?>
<html> <head> <script> $(document).ready(function () { $("p").text("The DOM is now loaded and can be manipulated."); }); </script> </head> <body> <script type="text/javascript"> setTimeout ( "doSomething()", 5000 ); function doSomething ( ) { $.ajax({ type: "POST", url: "kosz3.php", data: "name=John&location=Boston", success: function(msg){ alert( "Data Saved: " + msg ); } }); } </script> </body> </html>
$.ajax({ type: "POST", url: "kosz3.php", success: function(msg){ alert( "Data Saved: " + msg ); } });
<html> <head> <style>p { color:red; }</style> <script src="http://code.jquery.com/jquery-latest.min.js"></script> <script> $(document).ready(function () { $("p").text("The DOM is now loaded and can be manipulated."); }); </script> </head> <body> <script type="text/javascript"> jQuery(document).ready(function($) { setTimeout ( "doSomething()", 5000 ); function doSomething ( ) { $.ajax({ type: "POST", url: "kosz3.php", success: function(msg){ alert( "Data Saved: " + msg ); } }); } }); </script> </body> </html>
$(document).ready(function() { setTimeout ( "doSomething()", 5000 ); });
<html> <head> <script src="http://code.jquery.com/jquery-latest.min.js"></script> </head> <body> <?php ?> <script type="text/javascript"> $(document).ready(function() { setTimeout ( "doSomething()", 5000 ); }); function doSomething ( ) { $.ajax({ type: "POST", url: "kosz3.php", }); } </script> </body> </html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> <HTML> <HEAD> </HEAD> <BODY> <?php include('baza.php'); $ccc = $bbb[0] + 1; ?> </BODY> </HTML>
<html> <head> <style>p { color:red; }</style> <script src="http://code.jquery.com/jquery-latest.min.js"></script> <script> $(document).ready(function () { $("p").text("The DOM is now loaded and can be manipulated."); }); </script> </head> <body> <?php ?> <script type="text/javascript"> $(document).ready(function() { setTimeout ( "doSomething()", 5000 ); }); function doSomething ( ) { $.ajax({ type: "GET", url: "kosz3.php", success: function(msg){ alert( "Data Saved: " + msg ); } }); } </script> </body> </html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> <HTML> <HEAD> </HEAD> <BODY> <?php include('baza.php'); $ccc = $bbb[0] + 1; ?> </BODY> </HTML>
<script src="http://code.jquery.com/jquery-latest.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js"></script>