CodeIgniter Forums
help,, how to multiple jquery function on one page - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: help,, how to multiple jquery function on one page (/showthread.php?tid=54505)



help,, how to multiple jquery function on one page - El Forum - 09-11-2012

[eluser]wahmal[/eluser]
i have problem with multiple jquery function. If I change the menu's, autocomplte and datepicker function not working, only navigation fungtion. But if i refresh the page on the menu that I'd change, all functions working. what's worng? this my code :



help,, how to multiple jquery function on one page - El Forum - 09-11-2012

[eluser]wahmal[/eluser]
this my code :

Code:
<!--Jquery NAVIGASI-->
[removed][removed]
[removed][removed]
[removed][removed]
<!--CSS NAVIGASI-->
<link href="<?php echo base_url(); ?>atribut/navigasi/demo.css"  rel="stylesheet" type="text/css" >
<!--CSS TEMPLATE-->
<link href="<?php echo base_url(); ?>atribut/style.css"  rel="stylesheet" type="text/css" >
<!--Jquery auto serach-->
[removed][removed]
[removed][removed]
<link rel="stylesheet" href="<?php echo base_url(); ?>atribut/jquery/themes/base/jquery.ui.all.css" type="text/css" media="all" />
[removed][removed]
[removed][removed]
        [removed]

        function cari(){
            $("#nyari").autocomplete({
                minLength: 1,
                source:
                function(req, add){
                    $.ajax({
                        url: "<?php echo base_url(); ?>index.php/Cautocomplete/lookup/",
                        dataType: 'json',
                        type: 'POST',
                        data: req,
                        success:
                        function(data){
                            if(data.response =="true"){
                                add(data.message);
                            }
                        }
                    });
                }
            });
        }
$(function() {
  $( "#tanggal" ).datepicker({
   changeMonth: true,
   changeYear: true,
   showButtonPanel: true,
   dateFormat:"yy-mm-dd"
  });
});
     [removed]