Ver Mensaje Individual
  #1 (permalink)  
Antiguo 16/08/2013, 15:50
tutata_6
 
Fecha de Ingreso: julio-2012
Mensajes: 12
Antigüedad: 11 años, 9 meses
Puntos: 0
"funcion x" no esta definida

Bueno el problema que tengo es el siguiente: La función "ShowRecords()" que esta en ShowRecords.js no funciona y cuando leo la consola de chrome me dice que no esta definida pero no comprendo por que, por cierto ya revise la ruta de mi script y esta correcta y no encuentro otra razón porque no funcione.

El código de la pag. web:
Código HTML:
Ver original
  1. <!DOCTYPE html>
  2.  
  3. <html lang="ES-es">
  4.     <meta charset="utf-8">
  5.     <title>SimpleAdmin - Dashboard</title>
  6.    
  7.     <!-- Stylesheets -->
  8.     <link rel="stylesheet" href="js/fancybox/jquery.fancybox.css">
  9.     <link href='http://fonts.googleapis.com/css?family=Droid+Sans:400,700' rel='stylesheet'>
  10.     <link rel="stylesheet" href="css/style.css">
  11.    
  12.     <!-- Optimize for mobile devices -->
  13.     <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
  14.    
  15.     <!-- jQuery & JS files -->
  16.     <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
  17.     <script src="js/fancybox/jquery.fancybox.pack.js"></script>
  18.     <script src="js/script.js"></script>
  19.     <script src="js/ShowRecords.js"></script>
  20.     <script type="text/javascript">
  21.     ShowRecords(1,"sucursal");
  22.     </script>
  23. </head>
  24.  
  25.     <!-- TOP BAR -->
  26.     <div id="top-bar">
  27.        
  28.         <div class="page-full-width cf">
  29.  
  30.             <ul id="nav" class="fl">
  31.                 <li class="v-sep"><a href="#" class="round button dark menu-user image-left">Logged in as <strong>admin</strong></a>
  32.                     <ul>
  33.                         <li><a href="#">Change Password</a></li>
  34.                         <li><a href="#">Log out</a></li>
  35.                     </ul>
  36.                 </li>
  37.            
  38.                 <li><a href="#" class="round button dark menu-email-special image-left">3 new messages</a></li>
  39.                 <li><a href="#" class="round button dark menu-logoff image-left">Log out</a></li>
  40.                
  41.             </ul> <!-- end nav -->
  42.  
  43.         </div> <!-- end full-width --> 
  44.    
  45.     </div> <!-- end top-bar -->
  46.    
  47.    
  48.    
  49.     <!-- HEADER -->
  50.     <div id="header-with-tabs">
  51.        
  52.         <div class="page-full-width cf">
  53.    
  54.             <ul id="tabs" class="fl">
  55.                 <li><a href="dashboard.html" class="active-tab dashboard-tab">Dashboard</a></li>
  56.                 <li><a href="page-full-width.html">Full width page</a></li>
  57.                 <li><a href="page-other.html">Other page elements</a></li>
  58.             </ul> <!-- end tabs -->
  59.            
  60.             <!-- Change this image to your own company's logo -->
  61.             <!-- The logo will automatically be resized to 30px height. -->
  62.            
  63.         </div> <!-- end full-width --> 
  64.  
  65.     </div> <!-- end header -->
  66.    
  67.    
  68.    
  69.     <!-- MAIN CONTENT -->
  70.     <div id="content">
  71.        
  72.         <div class="page-full-width cf">
  73.  
  74.             <div class="side-menu fl">
  75.                
  76.                 <h3>Side Menu</h3>
  77.                 <ul>
  78.                     <li><a href="#">Side menu link</a></li>
  79.                     <li><a href="#">Another link</a></li>
  80.                     <li><a href="#">A third link</a></li>
  81.                     <li><a href="#">Fourth link</a></li>
  82.                 </ul>
  83.                
  84.             </div> <!-- end side-menu -->
  85.            
  86.             <div class="side-content fr">
  87.            
  88.                 <div class="content-module">
  89.                
  90.                     <div class="content-module-heading cf">
  91.                    
  92.                         <h3 class="fl">Table design</h3>
  93.                         <span class="fr expand-collapse-text">Click to collapse</span>
  94.                         <span class="fr expand-collapse-text initial-expand">Click to expand</span>
  95.                    
  96.                     </div> <!-- end content-module-heading -->
  97.                    
  98.                    
  99.                     <div class="content-module-main">
  100.                    
  101.                        
  102.                            
  103.                         <div id="waiting-div"><img src="images/ajax-loader.gif"></div>
  104.                        
  105.                    
  106.                     </div> <!-- end content-module-main -->
  107.                
  108.                 </div> <!-- end content-module -->
  109.                
  110.                  <!-- end content -->
  111.    
  112.    
  113.    
  114.     <!-- FOOTER -->
  115.     <div id="footer">
  116.  
  117.         <p>&copy; Copyright 2012 <a href="#">BlueHosting, LLC</a>. All rights reserved.</p>
  118.         <p><strong>SimpleAdmin</strong> theme by <a href="http://www.adipurdila.com">Adi Purdila</a></p>
  119.         <input type="text" id="table" disabled>sucursal</input>
  120.     </div> <!-- end footer -->
  121.  
  122. </body>
  123. </html>

el código javascript:

Código Javascript:
Ver original
  1. $(function(){
  2.     function ShowLoader(){
  3.         $("#waiting-div").fadeIn(function (){
  4.             $("#waiting-div").css("display","block");
  5.         });
  6.     }
  7.  
  8.     function HideLoader(){
  9.         $("#waiting-div").fadeOut(function(){
  10.             $("#waiting-div").css("display","none");
  11.         });
  12.     }
  13.  
  14.     function ShowRecords(page,table){
  15.         $.post('private/ShowRecord.php',{page:page,table:table},function(msg){
  16.             $(".content-module-main").html(msg);
  17.         });
  18.         }
  19.     $("pagination-list a").on("click",function(){
  20.         var actual_pag=$(".active").attr("id");
  21.         var page=$(this).attr("id");
  22.         var table=$("#table").val();
  23.         if (actual_pag!=page) {
  24.             ShowLoader();
  25.             ShowRecords(page,table);
  26.             HideLoader();
  27.         }
  28.         });
  29.     })