Discussion: javascript and jquery
4 messages from 4 displayed.
//= Settings::TRACKING_CODE_B ?> //= Settings::TRACKING_CODE ?>
Please, use the button between a smiley and B - it's for a
code. Paste your code again between the code
tags, because now it's
very unreadable.
<!--main page content-->
<div class="col-md-8"> <!--loads the content dynamically from the database-->
<div class="row">
<h2 class="text-center">Featured Products</h2>
<?php while ($product = mysqli_fetch_assoc($r)):?>
<div class="col-md-3">
<h4><?php echo $product['title'];?></h4>
<img src="<?php echo $product['image'];?>" alt="<?php echo $product['title'];?>" class="img-thumb"/>
<p class="list-price text-danger">list price: <s> Ksh<?php echo $product['list_price'];?></s></p>
<p class="price">Our price:Ksh<?php echo $product['price'];?></p>
<button type="button" class="btn btn-success" onclick="detailsmodal(<? $product['id']?>)"> Details</button>
</div>
<?php endwhile;?>
</div>
</div>
Javascript
<script>
function detailsmodal(id){
var data = {id;
jQuery.ajax({
url: <?=BASEURL;?>+ 'includes/detailsmodal.php',
method: "post",
data: data,
success: function(){
jQuery('body').append(data);
jQuery('#details-modal').modal('toggle');
},
error: function(){
alert("something went wrong");
}
});
}
</script>
If you need any help feel free to contact us.This is Chris professor at Assignment Planet, working for 5years. My company provide several services related to study for students.The assignment planet is a top-notch company that offers the java assignment help to its clients.
4 messages from 4 displayed.