Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
172
rated 0 times [  176] [ 4]  / answers: 1 / hits: 21373  / 11 Years ago, thu, july 25, 2013, 12:00:00

Java Script Code:



<script type=text/javascript>
$(function () {
var seatNo = 2;
str.push('<a title=' + seatNo + '>' + '<?php echo $thisPacket[seat]; ?>'</a>');
});
</script>


I want to concatenate between $thisPacket[seat] with java Script variable seatNo.

Just like php concate. example: $i = 1; $thisPacket[seat.$i];


More From » php

 Answers
120

I want to concatenate between $thisPacket[seat] with java Script
variable seatNo. Just like php concate. example: $i = 1;
$thisPacket[seat.$i];




No, this won't work because the PHP code runs on the server, and the javascript variable seatNo is not available until the javascript code executes on the client.


[#76759] Wednesday, July 24, 2013, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ethanc

Total Points: 57
Total Questions: 111
Total Answers: 111

Location: Vanuatu
Member since Fri, May 13, 2022
2 Years ago
;