1
Hello community Stack Over Flow, I’m trying to include pages via ajax
, but when I click to open the dropdown
it is ignored and adds the page of Index of
of WampServer
, how to proceed in such cases?
Here I put an image and the code JavaScript
:
$(function() {
$("#loading").hide();
$("ul.nav a").click(function() {
page = "template/pages/"+$(this).attr('href')
$("#loading").ajaxStart(function() {
$(this).show();
});
$("#loading").ajaxStop(function() {
$(this).hide();
});
$("#main").load(page)
return false;
});
});
Main: content :
<section id="main" class="section-main">
<img src="template/assets/images/icons/load.gif" id="loading">
<?php
include("./template/pages/meus-tickets.php");
?>
</section>
Menu:
<ul class="nav navbar-nav navbar-right">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
<i class="glyphicon glyphicon-user"></i> <span class="caret"></span>
</a>
<ul class="dropdown-menu">
<li><a href="#"><i class="glyphicon glyphicon-edit"></i> Editar perfil</a></li>
<li><a href="novo-ticket.php"><i class="glyphicon glyphicon-open"></i> Submeter um ticket</a></li>
<li role="separator" class="divider"></li>
<li><a href="#"><i class="glyphicon glyphicon-log-out"></i> Sair</a></li>
</ul>
</li>
</ul>
Note: I would like the links without dropdown
and with dropdown
were still functioning, I await answers. []’s
Add HTML as well, please
– Berriel
Added to main topic.
– Guilherme SpinXO