Studyon Minte9.com
jQuery

Study

Request



// variant 1
$.ajax({
  url: 'ajax/test.html',
  success: function(data) {
    $('#result').html(data);
  }
});

// variant 2
$('#result').load('ajax/test.html');


// variant 3

<span class="count-da"  id="count_da_<?php echo $recenzie['id']?>"><?php echo $recenzie['da'];?></span>
            <a href="javascript:void(0)" class="da"  id="da_<?php echo $recenzie['id'];?>">Da</a>
            <a href="javascript:void(0)" class="nu"  id="nu_<?php echo $recenzie['id'];?>">Nu</a>
<span class="count-nu" id="count_nu_<?php echo $recenzie['id']?>"><?php echo $recenzie['nu'];?></span>

....

$('.da, .nu').click(function(){
            var idTag = this.id;
            $.ajax({
               	type: "GET",
               	url: "/dealers/frontend/vot-comment/id/" + this.id,
               	success: function(msg){
                    if(msg == '1'){ $('#count_' + idTag ).html( parseInt($('#count_'+idTag).html())+1); }
               }
             });                
        });

....

$param = $this->getRequest()->getParam('id');
if($param && $this->_request->isXmlHttpRequest()){
}


// variant 4

                       Codeigniter <span id='codeigniter_version'></span>
			<script>
				$(document).ready(function(){
					$.ajax({
					  url: '/mysite/index.php/info/ci_version',
					  success: function(data) {
						$('#codeigniter_version').html(data);
					  }
					});
				});
			</script>


http://api.jquery.com/jQuery.ajax/