Click here to Skip to main content
16,005,037 members
Home / Discussions / JavaScript
   

JavaScript

 
QuestionDuplicate File Remover Code Pin
Rahul Michael26-Jan-14 18:10
Rahul Michael26-Jan-14 18:10 
QuestionRe: Duplicate File Remover Code Pin
Richard MacCutchan26-Jan-14 21:53
mveRichard MacCutchan26-Jan-14 21:53 
AnswerRe: Duplicate File Remover Code Pin
Rahul Michael27-Jan-14 6:09
Rahul Michael27-Jan-14 6:09 
GeneralRe: Duplicate File Remover Code Pin
Richard MacCutchan27-Jan-14 6:35
mveRichard MacCutchan27-Jan-14 6:35 
GeneralRe: Duplicate File Remover Code Pin
Thomas Daniels27-Jan-14 6:26
mentorThomas Daniels27-Jan-14 6:26 
QuestionAnyone can help me? Pin
ArjanD21-Jan-14 8:44
ArjanD21-Jan-14 8:44 
SuggestionRe: Anyone can help me? Pin
Richard Deeming21-Jan-14 10:15
mveRichard Deeming21-Jan-14 10:15 
QuestionHelp with my statement. Pin
Yhen Caisip18-Jan-14 16:56
Yhen Caisip18-Jan-14 16:56 
AnswerRe: Help with my statement. Pin
Peter Leow18-Jan-14 18:00
professionalPeter Leow18-Jan-14 18:00 
GeneralRe: Help with my statement. Pin
Yhen Caisip18-Jan-14 20:25
Yhen Caisip18-Jan-14 20:25 
GeneralRe: Help with my statement. Pin
Peter Leow18-Jan-14 20:29
professionalPeter Leow18-Jan-14 20:29 
GeneralRe: Help with my statement. Pin
Yhen Caisip18-Jan-14 20:48
Yhen Caisip18-Jan-14 20:48 
GeneralRe: Help with my statement. Pin
Peter Leow18-Jan-14 21:04
professionalPeter Leow18-Jan-14 21:04 
GeneralRe: Help with my statement. Pin
Yhen Caisip18-Jan-14 21:27
Yhen Caisip18-Jan-14 21:27 
GeneralRe: Help with my statement. Pin
Yhen Caisip18-Jan-14 21:36
Yhen Caisip18-Jan-14 21:36 
GeneralRe: Help with my statement. Pin
Yhen Caisip18-Jan-14 21:51
Yhen Caisip18-Jan-14 21:51 
GeneralRe: Help with my statement. Pin
Yhen Caisip18-Jan-14 23:21
Yhen Caisip18-Jan-14 23:21 
Hello i think the problem when getting the value from qty is from this.

<script>
		var timer = 0;
			$(document).ready(function() {	
					var from = $("#holder_from").val();
					var destination = $("#holder_to").val();
					var qty = $("#holder_qty").val()
				timer = setInterval(function() {	
					$.ajax({
						type : "POST",
						url : "select_seatmap.php",
						data : "from="+from+"&destination="+destination+"&qty="+qty,
						success : function(data) {
							$('#seatmap-wrapper').html(data);
						}
					});
				}, 1000);
			})
		</script>

Using the setinterval as a 1000 milliseconds finish it is like renewing the current last value of the qty which is in here.

<?php 
$qty = $_POST['qty'];
echo '<input type="hidden" id="qty" value="'.$qty.'">';
?>
<script>
$(document).ready(function(){
   var qty = parseInt($("#qty").val());

	jQuery('.a-seats').click(function(){
		clearInterval(timer);
		if(qty != 0){
			qty--;
		}
		if(qty == 0){
			$('.a-seats').unbind();
			
		}
	})
});
</script>


becuase of the interval, even before the user/customer finished his/her events, the qty would continuously get data with the post method. am i right? uhmm if ever i got the point, what ways do to make unbind run not being in the setInterval. because unbind could run depends on qty value and removing setInterval it works properly but the query or the seatmap will not update realtime unless u refresh the page. Sorry for my english. Thanks in advance
QuestionAdding Var Object to An Array Dynamically Pin
ASPnoob17-Jan-14 9:39
ASPnoob17-Jan-14 9:39 
AnswerRe: Adding Var Object to An Array Dynamically Pin
Graham Breach17-Jan-14 22:15
Graham Breach17-Jan-14 22:15 
GeneralRe: Adding Var Object to An Array Dynamically Pin
ASPnoob18-Jan-14 4:39
ASPnoob18-Jan-14 4:39 
AnswerRe: Adding Var Object to An Array Dynamically Pin
Hassan Oumar Mahamat31-Jan-14 3:24
professionalHassan Oumar Mahamat31-Jan-14 3:24 
QuestionQuery string null in redirects Pin
Vimalsoft(Pty) Ltd15-Jan-14 5:20
professionalVimalsoft(Pty) Ltd15-Jan-14 5:20 
QuestionRe: Query string null in redirects Pin
ZurdoDev21-Jan-14 5:04
professionalZurdoDev21-Jan-14 5:04 
Questionconvert krutidev to unicode Pin
Priyanka_a7-Jan-14 22:38
professionalPriyanka_a7-Jan-14 22:38 
QuestionFor non-programmer, Implementing following specific code example - Using JSON and File API to View Starred Google Reader Posts Pin
Member 1048791825-Dec-13 21:24
Member 1048791825-Dec-13 21:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.