Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

mauricio lanner

Conflito de codigos

Recommended Posts

Ola pessoal, estou com um problemão aqui, quando colo a importação de duas bibliotecas especificas uma delas acaba dando erro e não funcionando.

 

Alguem consegue me dizer o pq que esses dois arquivos não estão funcionando quando juntos?

Os revoltados são:

<script type="text/javascript" src="js/custom.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>

 

a biblioteca completa é

	<script type="text/javascript" src="js/jquery-1.3.2.js"></script>
	<script type="text/javascript" src="js/superfish.js"></script>
	<script type="text/javascript" src="js/jquery-ui-1.7.2.js"></script>
	<script type="text/javascript" src="js/tooltip.js"></script>
	<script type="text/javascript" src="js/tablesorter.js"></script>
	<script type="text/javascript" src="js/tablesorter-pager.js"></script>
	<script type="text/javascript" src="js/cookie.js"></script>
	<script type='text/javascript' src='../jquery/jquery.maskMoney.js'></script>
    <script type='text/javascript' src='../jquery/jquery.maskedinput-1.1.4.pack.js'></script>
    
    
    <script type='text/javascript' src='../jquery/jquery.validate.js'></script>


	<script type="text/javascript" src="js/custom.js"></script>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
	<!--[if IE 6]>
	<link href="css/ie6.css" rel="stylesheet" media="all" />
	
	<script src="js/pngfix.js"></script>
	<script>
	  /* EXAMPLE */
	  DD_belatedPNG.fix('.logo, .other ul#dashboard-buttons li a');

	</script>
	<![endif]-->
	<!--[if IE 7]>
	<link href="css/ie7.css" rel="stylesheet" media="all" />
	<![endif]-->
<script type="text/javascript" src="http://updateyourbrowser.net/asn.js"> </script>

<script type="text/javascript" src="./editor/jscripts/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript">
	tinyMCE.init({
		// General options
		language : "pt",
		mode : "exact",
		elements : "in_descricao,in_conteudo,in_instrutores",
		theme : "advanced",
		// Theme options
		theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,link,unlink,|,code|,image",
		theme_advanced_buttons2 : "",
		theme_advanced_buttons3 : "",
		theme_advanced_buttons4 : "",
		theme_advanced_toolbar_location : "top",
		theme_advanced_toolbar_align : "top",
		theme_advanced_statusbar_location : false,
		theme_advanced_resizing : false,


		// Example content CSS (should be your site CSS)
		content_css : "css/content.css",

		// Drop lists for link/image/media/template dialogs
		template_external_list_url : "lists/template_list.js",
		external_link_list_url : "lists/link_list.js",
		external_image_list_url : "lists/image_list.js",
		media_external_list_url : "lists/media_list.js",

		// Style formats
		style_formats : [
			{title : 'Bold text', inline : 'b'},
			{title : 'Red text', inline : 'span', styles : {color : '#ff0000'}},
			{title : 'Red header', block : 'h1', styles : {color : '#ff0000'}},
			{title : 'Example 1', inline : 'span', classes : 'example1'},
			{title : 'Example 2', inline : 'span', classes : 'example2'},
			{title : 'Table styles'},
			{title : 'Table row 1', selector : 'tr', classes : 'tablerow1'}
		],

		// Replace values for the template plugin
		template_replace_values : {
			username : "Some User",
			staffid : "991234"
		}
	});
</script>

 

 

Compartilhar este post


Link para o post
Compartilhar em outros sites

oq tem dentro do custom.js ?

 

vc está chamando o jQuery duas vezes, chame uma só:

	<script type="text/javascript" src="js/jquery-1.3.2.js"></script>
	<script type="text/javascript" src="js/superfish.js"></script>
	<script type="text/javascript" src="js/jquery-ui-1.7.2.js"></script>
	<script type="text/javascript" src="js/tooltip.js"></script>
	<script type="text/javascript" src="js/tablesorter.js"></script>
	<script type="text/javascript" src="js/tablesorter-pager.js"></script>
	<script type="text/javascript" src="js/cookie.js"></script>
	<script type='text/javascript' src='../jquery/jquery.maskMoney.js'></script>
    <script type='text/javascript' src='../jquery/jquery.maskedinput-1.1.4.pack.js'></script>
    
    
    <script type='text/javascript' src='../jquery/jquery.validate.js'></script>


	<script type="text/javascript" src="js/custom.js"></script>
    <!-- removi jquery daqui -->


	<!--[if IE 6]>
	<link href="css/ie6.css" rel="stylesheet" media="all" />

Compartilhar este post


Link para o post
Compartilhar em outros sites

se eu tirar o custon, o menu não funciona

 

 

Custon.js

$(document).ready(function() { 

	// Navigation menu

	$('ul#navigation').superfish({ 
		delay:       1000,
		animation:   {opacity:'show',height:'show'},
		speed:       'fast',
		autoArrows:  true,
		dropShadows: false
	});
	
	$('ul#navigation li').hover(function(){
		$(this).addClass('sfHover2');
	},
	function(){
		$(this).removeClass('sfHover2');
	});

	// Accordion
	$("#accordion, #accordion2").accordion({ header: "h3" });

	// Tabs
	$('#tabs, #tabs2, #tabs5').tabs();

	
	$("#in_categoria").change(function(){	
		 $.ajax({
			   data:"id="+this.value,
			   type: "POST",
			   url: "sel_sub.php",
			   success: function(html){
					$("#sub_cat").empty().append(html);
			   }
		 });	
	})	


	// Login Dialog			
	$('#login').dialog({
		autoOpen: false,
		width: 300,
		height: 230,
		bgiframe: true,
		modal: true,
		buttons: {
			"Login": function() { 
				$(this).dialog("close"); 
			}, 
			"Close": function() { 
				$(this).dialog("close"); 
			} 
		}
	});
	
	// Dialog Link
	$('#dialog_link').click(function(){
		$('#dialog').dialog('open');
		return false;
	});



	// Dialog auto open			
	$('#welcome_login').dialog({
		autoOpen: true,
		width: 370,
		height: 430,
		bgiframe: true,
		modal: true,
		buttons: {
			"Logar !": function() {
				document.form1.submit();
			}
		}
	});
	// Datepicker
	$('#datepicker').datepicker({
		inline: true
	});
	// Datepicker
	$('#datepicker2').datepicker({
		inline: true
	});

	$("#datepicker" ).datepicker( "option", "dateFormat", "dd/mm/yy");

	$("#datepicker2" ).datepicker( "option", "dateFormat", "dd/mm/yy");
	
	//Hover states on the static widgets
	$('#dialog_link, ul#icons li').hover(
		function() { $(this).addClass('ui-state-hover'); }, 
		function() { $(this).removeClass('ui-state-hover'); }
	);
	
	//Sortable

	$(".column").sortable({
		connectWith: '.column'
	});

	//Sidebar only sortable boxes
	$(".side-col").sortable({
		axis: 'y',
		connectWith: '.side-col'
	});

	$(".portlet").addClass("ui-widget ui-widget-content ui-helper-clearfix ui-corner-all")
		.find(".portlet-header")
			.addClass("ui-widget-header")
			.prepend('<span class="ui-icon ui-icon-circle-arrow-s"></span>')
			.end()
		.find(".portlet-content");

	$(".portlet-header .ui-icon").click(function() {
		$(this).toggleClass("ui-icon-circle-arrow-n");
		$(this).parents(".portlet:first").find(".portlet-content").slideToggle();
	});

	$(".column").disableSelection();


	/* Table Sorter */
	$("#sort-table")
	.tablesorter({
		widgets: ['zebra'],
		headers: { 
		            // assign the secound column (we start counting zero) 
		            0: { 
		                // disable it by setting the property sorter to false 
		                sorter: false 
		            }, 
		            // assign the third column (we start counting zero) 
		            6: { 
		                // disable it by setting the property sorter to false 
		                sorter: false 
		            } 
		        } 
	})
	
	.tablesorterPager({container: $("#pager")}); 

	$(".header").append('<span class="ui-icon ui-icon-carat-2-n-s"></span>');

	

	$("#busca_nome").keyup(function(){
		 if(this.value != "")
		 {
			 $.ajax({
				   data:"nome="+this.value,
				   type: "POST",
				   url: "resultado_busca.php",
				   success: function(html){
						$("#resultado").empty().append(html);
				   }
			 });
		 }

	})


	$(".btn_atualizar_cart").click(function(){
		idcarrinho = this.id;
		idcarrinho = idcarrinho.replace("bt_","");
		qtd = $("#qtd_"+idcarrinho).val();
		valor = $("#valor_"+idcarrinho).val();
			 $.ajax({
				   data:"quantidade="+qtd+"&valor="+valor+"&id="+idcarrinho,
				   type: "POST",
				   url: "up_qtd.php",
				   success: function(html){
						location.reload(true);
				   }
			 });
	})


	$("#busca_orc").click(function(){
		 if(this.value != "")
		 {
			 $.ajax({
				   data:"nome="+$("#busca_orc_txt").val(),
				   type: "POST",
				   url: "resultado_orc.php",
				   success: function(html){
						$("#resultado").empty().append(html);
				   }
			 });
		 }

	})

	$("#busca_cli").keyup(function(){
		 if(this.value != "")
		 {
			 $.ajax({
				   data:"nome="+this.value,
				   type: "POST",
				   url: "resultado_cliente.php",
				   success: function(html){
						$("#resultado").empty().append(html);
				   }
			 });
		 }

	})


});

	/* Tooltip */

	$(function() {
		$('.tooltip').tooltip({
			track: true,
			delay: 0,
			showURL: false,
			showBody: " - ",
			fade: 250
			});
		});
		
	/* Theme changer - set cookie */

    $(function() {
       
		$("link[title='style']").attr("href","css/styles/default/ui.css");
        $('a.set_theme').click(function() {
           	var theme_name = $(this).attr("id");
			$("link[title='style']").attr("href","css/styles/" + theme_name + "/ui.css");
			$.cookie('theme', theme_name );
			$('a.set_theme').css("fontWeight","normal");
			$(this).css("fontWeight","bold");
        });
		
		var theme = $.cookie('theme');
	    
		if (theme == 'default') {
	        $("link[title='style']").attr("href","css/styles/default/ui.css");
	    };
	    
		if (theme == 'light_blue') {
	        $("link[title='style']").attr("href","css/styles/light_blue/ui.css");
	    };
	

	/* Layout option - Change layout from fluid to fixed with set cookie */
       
       $("#fluid_layout a").click (function(){
			$("#fluid_layout").hide();
			$("#fixed_layout").show();
			$("#page-wrapper").removeClass('fixed');
			$.cookie('layout', 'fluid' );
       });

       $("#fixed_layout a").click (function(){
			$("#fixed_layout").hide();
			$("#fluid_layout").show();
			$("#page-wrapper").addClass('fixed');
			$.cookie('layout', 'fixed' );
       });

	    var layout = $.cookie('layout');
	    
		if (layout == 'fixed') {
			$("#fixed_layout").hide();
			$("#fluid_layout").show();
	        $("#page-wrapper").addClass('fixed');
	    };

		if (layout == 'fluid') {
			$("#fixed_layout").show();
			$("#fluid_layout").hide();
	        $("#page-wrapper").addClass('fluid');
	    };

	$("#in_data").mask("99/99/9999");
	$("#in_valor").maskMoney({symbol:'R$ ', showSymbol:true, thousands:'.', decimal:',', symbolStay: false});
	$(".valorcart").maskMoney({symbol:'R$ ', showSymbol:true, thousands:'.', decimal:',', symbolStay: false});
    });
    
    
 	/* Check all table rows */
	
var checkflag = "false";
function check(field) {
if (checkflag == "false") {
for (i = 0; i < field.length; i++) {
field[i].checked = true;}
checkflag = "true";
return "check_all"; }
else {
for (i = 0; i < field.length; i++) {
field[i].checked = false; }
checkflag = "false";
return "check_none"; }
}

Compartilhar este post


Link para o post
Compartilhar em outros sites

ok, mas retire a duplicação da chamada a lib jQuery, conforme informei no codigo q postei.

Compartilhar este post


Link para o post
Compartilhar em outros sites

vc não está entendendo oq eu disse. Deixe assim as suas tags:

	<script type="text/javascript" src="js/jquery-1.3.2.js"></script>

<script type="text/javascript" src="js/superfish.js"></script>

<script type="text/javascript" src="js/jquery-ui-1.7.2.js"></script>

<script type="text/javascript" src="js/tooltip.js"></script>

<script type="text/javascript" src="js/tablesorter.js"></script>

<script type="text/javascript" src="js/tablesorter-pager.js"></script>

<script type="text/javascript" src="js/cookie.js"></script>

<script type='text/javascript' src='../jquery/jquery.maskMoney.js'></script>

<script type='text/javascript' src='../jquery/jquery.maskedinput-1.1.4.pack.js'></script>

 

 

<script type='text/javascript' src='../jquery/jquery.validate.js'></script>

 

 

<script type="text/javascript" src="js/custom.js"></script>

<!-- removi jquery daqui -->

 

 

<!--[if IE 6]>

<link href="css/ie6.css" rel="stylesheet" media="all" />

não existe conflito de jQuery + jQuery, oq deve ser feito é apenas importar a lib uma unica vez. E vc estava importando 2.

Compartilhar este post


Link para o post
Compartilhar em outros sites

Eu entendi o que vc quis dizer, o grande problema é que quando eu retiro esse código o sistema de busca na tabela para de funcionar. Veja o Código:

 

<? include('header_total.php'); ?>
<? include('select.php'); ?>
<? include('update.php'); ?>
<script>                
	function del(n)
	{
		if(confirm("Deseja realmente apagar este produto?"))
		{
			location.href ="cadProduto.php?n="+n;
		}
	}                
</script>
	<div id="page-wrapper">
		<div id="main-wrapper">
			<div id="main-content">
				<div class="title title-spacing">
					<h2>Pesquisa de Produto</h2>
					Tela pesquisa | Produto
				</div>


				<div class="portlet ui-widget ui-widget-content ui-helper-clearfix ui-corner-all form-container">
					<div class="portlet-header ui-widget-header">Pesquisa Produto</div>
                     <div class="portlet-content">
					   <ul>
						<li>
                            <div> <label>Começe a digitar o nome do produto:</label>
                                <input type="text" tabindex="1" maxlength="255" class="field text medium" name="busca_nome" id="busca_nome" />
                               
                            </div>
                    	</li>
					   </ul>
				</div>
		 </div>
        <div class="clearfix"> </div>
  		<div class="portlet ui-widget ui-widget-content ui-helper-clearfix ui-corner-all form-container">
					<div class="portlet-header ui-widget-header">Resultado da pesquisa</div>
					<div class="portlet-content">
                       <table cellspacing="0" width="100%">
                            <thead>
                                <tr>
                                  <td width="23%">Produto</td>
                                    <td width="60%">Descrição</td>
                                    <td width="8%"> </td>
                    
                                    <td width="9%"> </td>
                                </tr>
                            </thead>
                        </table>
					</div>
					<div class="portlet-content" id="resultado">
<?
	function foto($codigo)
	{
		$select2 =  new Select;
		$options2 = $select2->select_generico("tb_galeria",'codigo = "'.$codigo.'"',"");
		if(is_array($options2))
		foreach($options2 as $foto)
		{
				
			$fotos = $foto['diretorio'];
		}
	
		return $fotos;
	}


	$categoria = $select->select_generico("tb_produto","","6");
	if(is_array($categoria))
	{
		foreach($categoria as $option)
		{
			$tr .=
			'
				<tr>
					<td  width="9%" valign="middle"><img width="96" src="../thumbnails/'.foto($option['codigo']).'" /></td>
					<td  width="14%" valign="middle">'.$option['produto'].'</td>
					<td width="60%">'.$option['descricao'].'</td>
					<td width="8%">
						<ul id="icons" class="ui-widget ui-helper-clearfix">			
							<li class="ui-state-default ui-corner-all" title="Alterar Produto"><a href="avedProduto.php?i='.$option['id'].'"><span class="ui-icon ui-icon-script"></span></a></li>								
						</ul>
					</td>
					<td width="9%">
						<ul id="icons" class="ui-widget ui-helper-clearfix">			
							<li onclick="del('.$option['id'].')" class="ui-state-default ui-corner-all" title="Excluir Produto"><span class="ui-icon ui-icon-close"></span></li>								
						</ul>
					</td>
				</tr>
			';
		}
	}else
{
$tr  =
			'
				<tr>
					<td width="100%" colspan="4"><strong>Nenhum produto encontrado</strong></td>
				</tr>
			';

}
?>	
<div class="hastable">
	<table cellspacing="0">
		<tbody>
			<?=$tr?>        
		</tbody>
	</table>
        <form method="post" action="../atual/exemplo.html" id="frm-filtro">
      <p>
        <label for="pesquisar">Pesquisar</label>
        <input type="text" id="pesquisar" name="pesquisar" size="30" />
      </p>
    </form>
 <?php
 echo"<table width='100%' cellspacing='0' summary='Tabela de dados fictícios'>
      <thead>
        <tr>
          <th><input type='checkbox' value='1' id='marcar-todos' name='marcar-todos' /></th>
          <th>ID</th>
          <th>Nome</th>
          <th>Área de interesse:</th>
          <th>Estado</th>
          <th>Tel:</th>
          <th>Email:</th>
          <th>Cadastrado em:</th>
          <th>Feedback</th>
          <th>Visualizar</th>
          <th>FeedBack</th>
        </tr>
      </thead>";
 include('../include/conexao.php');
$sql="SELECT * FROM usuarios_cadastra";
$rs=mysql_query($sql) or die ("erro ao seleciona".$sql);
while($linha=mysql_fetch_array($rs))
{
//seleciona todo os dados do usuario
$id_usuario=$linha["id_usuario"];
$nome_completo=$linha["nome_completo"];
$cpf=$linha["cpf"];
$rg=$linha["rg"];
$email=$linha["email"];
$data_nasc=$linha["data_nasc"];
$sexo=$linha["sexo"];
$estado_civil=$linha["estado_civil"];
$filho_quant=$linha["filho_quant"];
$nacionalidade=$linha["nacionalidade"];
$naturalidade=$linha["naturalidade"];
$tele_1=$linha["tele_1"];
$tel_2=$linha["tel_2"];
$tel_3=$linha["tel_3"];
$endere=$linha["endere"];
$cidade=$linha["cidade"];
$estado=$linha["estado"];
$bairro=$linha["bairro"];
$cep=$linha["cep"];
$estagio=$linha["estagio"];
$salario=$linha["salario"];
$viagem=$linha["viagem"];
$portador=$linha["portador"];
$complemento=$linha["complemento"];
$interesse=$linha['interesse'];
$data_criacao=$linha['data_criacao'];
 
 echo   "      <tbody>
        <tr>
          <td><input type='checkbox' value='1' name='marcar[]' /></td>
					<td>$id_usuario</td>
          <td>$nome_completo</td>
          <td>$interesse</td>
          <td>$estado - $cidade</td>
          <td>$tele_1</td>
          <td>$email</td>
          <td>$data_criacao</td>
          <td>$complemento</td>
          <td><a href='curriculo.php?id_usuario=$id_usuario' target='_blank'><img src='../atual/edit.png' width='16' height='16' /></a></td>
          <td><a href='feedback.php?id_usuario=$id_usuario'><img src='../atual/feed.png' width='16' height='16' /></a></td>
        </tr>
      </tbody>
	";
}
echo"</table>";
 ?>      

    
<script>
    $(function(){
      
      $('table > tbody > tr:odd').addClass('odd');
      
      $('table > tbody > tr').hover(function(){
        $(this).toggleClass('hover');
      });
      
      $('#marcar-todos').click(function(){
        $('table > tbody > tr > td > :checkbox')
          .attr('checked', $(this).is(':checked'))
          .trigger('change');
      });
      
      $('table > tbody > tr > td > :checkbox').bind('click change', function(){
        var tr = $(this).parent().parent();
        if($(this).is(':checked')) $(tr).addClass('selected');
        else $(tr).removeClass('selected');
      });
      
      $('form').submit(function(e){ e.preventDefault(); });
      
      $('#pesquisar').keydown(function(){
        var encontrou = false;
        var termo = $(this).val().toLowerCase();
        $('table > tbody > tr').each(function(){
          $(this).find('td').each(function(){
            if($(this).text().toLowerCase().indexOf(termo) > -1) encontrou = true;
          });
          if(!encontrou) $(this).hide();
          else $(this).show();
          encontrou = false;
        });
      });
      
      $("tableasas") 
        .tablesorter({
          dateFormat: 'uk',
          headers: {
            0: {
              sorter: false
            },
            5: {
              sorter: false
            }
          }
        }) 
        .tablesorterPager({container: $("#pager")})
        .bind('sortEnd', function(){
          $('table > tbody > tr').removeClass('odd');
          $('table > tbody > tr:odd').addClass('odd');
        });
      
    });
    </script>
</div>
					</div>
			  </div>


				<div class="clearfix"></div>

			</div>
			<div class="clearfix"></div>
		</div>
<?php include('sidebar.php'); ?>
	</div>
	<div class="clearfix"></div>
<?php include('footer.php'); ?>
</body>
</html>

Compartilhar este post


Link para o post
Compartilhar em outros sites

deixe as tags conforme informei, e veja no console de erros oq aparece.

 

Ctrl+Shift+J no Firefox

Compartilhar este post


Link para o post
Compartilhar em outros sites


Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost/curriculo_ativo_testes/jquery/jquery.validate.js

Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost/curriculo_ativo_testes/jquery/jquery.maskMoney.js

Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost/curriculo_ativo_testes/jquery/jquery.maskedinput-1.1.4.pack.js

Uncaught TypeError: Object #<Object> has no method 'mask' custom.js:278

2Uncaught TypeError: object is not a function asn.js:9



Compartilhar este post


Link para o post
Compartilhar em outros sites

pronto, corrija os caminhos. Não tá achando os seus arquivos.

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.