skip to Main Content

Get specify parent element id using his class – Jquery ajax

I try get id parent p div (class mainRow), but my code in console return undefinied: <div class="row mainRow" id="someId"> <div class="selected"> <p onclick="checkParentId(this)">Hello</p> </div> </div> <script> function checkParentId(element){ var a = $(element).parent( ".mainRow"); var b = $(a).attr("id"); console.log(b); }…

VIEW QUESTION

how to do ajax pagination in Django? – Jquery ajax

!! I have a model named blog !! class blog(models.Model): image = models.ImageField(upload_to='Media/awards') title = models.CharField(max_length=255,blank=True) content = models.TextField(blank=True) and in the frontend I have <div class="col-md-6" id= "mydiv"> <div> <!-- pagination design start --> <div class="blog_bottom_pagination"> <div class="counter">/</div> <button…

VIEW QUESTION

How to submit form without the page reloading – Jquery ajax

I have this form <form action="" method="post" enctype="multipart/form-data" onsubmit="submit()"> <input id="name" class="btn" type="file" name="pic" multiple> <br/><br/> <button class="btn btn-primary" type="submit" id="submit" name="submit">UPLOAD</button> </form> <br/><br/> Uploaded file: <a target="blank" href="<?php echo $fileurl;?>"><?php echo $fileurl;?></a> and I have this script <script> function…

VIEW QUESTION
Back To Top
Search