Welcome Guest, Not a member yet? Register   Sign In
Refreshing page in codeigniter
#2

[eluser]InsiteFX[/eluser]
Try this.

Replace $ in scrpit tags with s
Code:
<$cript type="text/javascript">
$(document).ready(function(){

$("select").change(function () {
    
        var country=$("#country").val();
    
      //alert (country);
        $.ajax({
        type: "POST",
        url: "&lt;?php echo base_url('countries_json/post_action');?&gt;",
      // using the below code
        url: base_url+"countries_json/post_action",

        dataType: "json",
        data: "country="+country,
        cache:false,
        success:
          function(data){
            $("#form_tag").html(data);
  
          }
        
        });

      return false;

    });
  
});
</$cript>

// You can also add this to your html document header section.

&lt;head&gt;
<$cript type="text/javascript" charset="utf-8">
  //&lt;![CDATA[
   var base_url = "&lt;?php echo base_url(); ?&gt;";
   var site_url = "&lt;?php echo site_url(); ?&gt;";
  // ]]>
</$cript>
&lt;/head&gt;

If you have removed index.php using .htaccess then you need to include index.php in your url links.


Messages In This Thread
Refreshing page in codeigniter - by El Forum - 01-29-2013, 10:50 PM
Refreshing page in codeigniter - by El Forum - 01-30-2013, 07:29 PM



Theme © iAndrew 2016 - Forum software by © MyBB