Category : javascript

i try to show a div with diffent text after select a radio button and hide all the other divs <?php foreach ($items as $item){ $i=1; echo ‘ <div class="form-check"> <input class="form-check-input" type="radio" name="radio1" id="detail_variant’.$i.’" > <label class="form-check-label">’.$item[‘title’].'</label> </div>’; $detail_variant_html.=" <div id=’detail_variant".$i."’> <p> size: ".$item[‘size’."<br> Color: ".$item[‘color’]."<br> Garment:".$item[‘garment’]." </p> </div>"; $i++; } echo ‘ <div ..

Read more

I have a little problem, the point is that my array is not getting content. $staff = array( "permissions" => false, "staff" => true, "group" => 3 ); echo json_encode($staff); let staff = []; $.ajax({ type: "POST", url: "../includes/signin.inc.php", }) .done(function (data) { staff = JSON.parse(data); console.log(staff); }) .fail(function (xhr, status, error) { alert(status); }); ..

Read more

I’ve a function which feeds a chart with fixed data: function drawChart() { var data = google.visualization.arrayToDataTable([ [‘Date’, ‘CPU Temp’], [‘2004’, 340], [‘2005’, 460], [‘2006’, 1120], [‘2007′, 540] ]); } I’d like to replace the fixed data with the one read from a DB table containing two columns: date and temperature. The read data is ..

Read more