pass date variable to javascript

How to pass date variable to jquery function…

function getseatlayout()
{

                var dt='2014-12-12';
                var table='<table border="1" id="bus_ser">';
                table += '<tr bgcolor="red"><td>SELECT SERVICE<td>ROUTE</td><td>TIME</td><td>SEATS BOOKED</td></tr>';
                 table+='<tr><td>55</td><td><input type="button" onclick="don('+dt+');"></td></tr>' ;
                            $("#t").append(table);
}
  function don(a)
  {
    var d= this.stringToDate(a);
     alert(d);
  }
  </script>

To do it properly you should use jquery to fetch data from the server side (php)
http://api.jquery.com/jQuery.get/

Or you could just echo the data into the javascript part of your code. Which is just wrong on so many levels.

Sponsor our Newsletter | Privacy Policy | Terms of Service