troubleshooting Question

jquery not working after div reload

Avatar of Hayat IHYA
Hayat IHYA asked on
AJAXjQuery
4 Comments1 Solution912 ViewsLast Modified:
Hi my code was working perfectly suddenly it's stopped working. I have search using ajax, after search "div.results" is reload the Jquery is reloaded too. If I click on the "red heart" div should appear it's working normal but when I search and click, nothing working. http://gbctravel.com/hachem/pub/public/, from "Inspect element" I can see that when I click the div flashes but nothing happen !! any Idea?!!
Ajax :
function getArticless(url){
    var sq = $('#query').val();
    var price = $('#query').val();
        $.ajax({

             url: url + '?query=' + sq,
             type: "get",
            datatype: "html",  
        }).done(function(data){
            console.log(data);
            $('#sort').show();
            $('#sort').html('<h3>Hôtels populaires, priorité : </h3><span class="adress" style="    padding-top: 15px;">Price descending.</span><ul class="top-right-nav"><li><a  style="    padding-top: 15px;" href="/min" id="desc">Trier Par Price uniquement</a></li></ul>');
$(".row.deals.results").empty().hide();
$(".row.deals.results").append(data);
$('.row.deals.results').fadeIn(2000);        
        });
    }

Jquery:

function hidethis(id){
  $('#listdiv_'+id).toggle();
}

html:

<article class="one-third">
   <div id="listbutton" onclick="hidethis(0)" class="bookmark"></div>
   <div id="listdiv_0" style="display:none" class="bookmarklist">
      <div style="padding: 12px 8px;"> <span class="" style="float:left; font-size: 16px;">My hotel Lists</span><span class="cancelbookmark" onclick="hidethis(0)"></span></div>
      <div class="createlist"><a onclick="showthis(0)" class="createlist_0 ">Create new hotel list</a></div>
      <div id="createlistdiv_0" class="createlistdiv" style="display:none;">
         <input type="text" class="inputcreatelist_0" style="width: 60%; float: left; height: 30px;">
            <span class="validaddlist validaddlist_0" onclick="sendthis(&quot;0,15013&quot;)"></span>
            <span class="cancelbookmark morething" onclick="showthis(0)"></span>
</div>
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 4 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros