[eluser]Tanvir[/eluser]
Hi I m new to CI. I cant get a simple jquery ajax to work. Heres my code-
This is my controller blog.php
Code:
<?php
class Blog extends CI_Controller{
public function __construct()
{ parent :: __construct() ;
$this->load->helper('url');
}
public function index()
{ }
public function ajaxShow(){
$this->load->view("ajaxDemo_view");
}
}
?>
this is my View -ajaxDemo_view.php
Code:
<html>
<head>
[removed] [removed]
[removed] [removed]
</head>
<body>
<button id='btn'> SHOW AJAX</button> <p>
<div id='divAjax'> AJAX TEXT HERE </div>
</body>
</html>
this is js file ajaxDemo.js
Code:
$(function() {
$("#btn").click( function(){
$("#divAjax").load("/ci/assets/js/test.php");
});
});