2016-12-31 5 views
4

画像onclickを使用してdivをリフレッシュしたい。ここで私はイメージを持っています、そのイメージIDは '売り手'です、onemore div IDは 'sellChart'です。 コード:画像をクリックしながら特定のdivをリフレッシュする方法

<div class="col-xs-12 col-lg-6 col-sm-6 col-md-6 index_table_three" id="sellChart"> 
         <div class="row" id="title"> 
          <div class="col-xs-6 col-sm-6 col-lg-6 col-md-6" id=""> 
           {{ Form::open(array('url' => 'lookup/be-check', 'enctype' => 'multipart/form-data', 'class' => 'form-inline', 'id' => 'sellChartForm')) }}          
           {{ Form::select('date_time', array($end_date.';'.$today => 'today', $lastWeek.';'.$today => 'Last 7 days', $lastMonth.';'.$today => 'One Month', '' => 'Custom Range'), $end_date.';'.$today, array('id' => 'date_time', 'onchange' => 'GetChangeDate()')) }} 
           {{ Form::Submit('Apply', array('id' => 'getSellRange', 'class' => 'getSellRange'))}} 
           {{ Form::close() }} 
          </div> 
          <div class="col-xs-4 col-sm-4 col-lg-4 col-md-4" id=""> 
           <h4>Sell property lists</h4> 
          </div> 
          <div class="col-xs-2 col-sm-2 col-lg-2 col-md-2" id=""> 
           <img src="<?php echo SITE_PATH . '/mb-images/reset.png' ?>" width="35px;" height="35px;" class="img-responsive center-block" id="sellhide" /> 
          </div> 
         </div> 
         <div class="row" id="sellDrawChart"> 
          <h5 style="margin-right:70%;"><b>Property type</b></h5> 
          <canvas id="sellCanvas" ></canvas> 
          <h6 style="margin-top:0px;margin-left:80%;"><b>No of property count</b></h6> 
         </div> 
        </div> 

スクリプト:私は多くの方法を試してみました

$(function() { 
     $('#sellhide').on('click', function() { 
      $('#sellChart').html(); 
     }); 
}); 

は、そのスクリプトを受け入れません。

+1

あなたの質問が明確ではありません。 –

+2

クリックイベントでajaxコールを試しましたか? –

+1

$( '#sellChart').html();既存のHTMLのみを返します。 –

答えて

2

使用jQueryのget()メソッド:たとえば https://api.jquery.com/jquery.get/

$.get("ajax/test.html", function(data) { 
    $(".result").html(data); 
    alert("Load was performed."); 
}); 
関連する問題