Заглавието напълно отговаря на състоянието ми, но не и на постижението ми.
Имам файла dokumenti.php,който ползва темплейта dokumenti.html, ето ги и тях:
<?php
if ($_SESSION['is_logged'] === true) {
include 'source/lib.php';
include 'nazad.php';
$filename = 'template/dokumenti.html';
$file = fopen($filename, 'r'); $content = str_replace('{{IZDATEL}}', SetUp
::$izdatel, $content); $content = str_replace('{{SNIMKA}}', snimka
($_SESSION['user_pic']), $content); $content = str_replace('{{TOP}}', top
('Документи'), $content); $content = str_replace('{{NAZAD}}', nazad
(), $content); $content = str_replace('{{CONTENT}}', '<div class="result"></div>', $content); echo $content;
} else {
header('Location: index.php'); }
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="bg" xml:lang="bg"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta name="Author" content="hankrum.info" /> <link rel="stylesheet" href="css/{{CSS}}" type="text/css" /> <script type="text/javascript" src="js/lib.js"> {{SNIMKA}}
{{TOP}}
{{NAZAD}}
<a class="buton" href="dokumenti.php">Изчистване
</a><br /><br /> <span class="icon"><a id="1" class="toc" href="#" ><img src="resource/pic/faktura.png" alt="Ф" />Фактури
</a></span> <span style="margin-top: -92px; margin-left: 250px;" class="icon"><a id="2" class="toc" href="#" ><img src="resource/pic/garanciq.png" alt="Т" />Гаранционни карти
</a></span> <span style="margin-top: -92px; margin-left: 500px;" class="icon"><a id="3" class="toc" href="#" ><img src="resource/pic/razpiska.png" alt="Т" />Разписки
</a></span> <span style="margin-top: -92px; margin-left: 750px;" class="icon"><a id="4" class="toc" href="#" ><img src="resource/pic/search_faktura.png" alt="Т" />Статистики
</a></span> {{CONTENT}}
зареждам си jquery-то и ето ми го JS-файла
$(document).ready(function(){
$('.toc').click(function(){
var $id = $(this).attr('id');
$('.result').hide(1);
$.ajax({
url: 'dokumenti.php?c='+$id,
success: function(data){
$('.result').html(data);
$('.result').slideDown(1500);
alert('Dobre e!!!')
}
});
});
});
Проблема е, че не стигам до съобщението "Dobre e!!!".
Къде греша?
п.п. Хич ме няма с този AJAX(то не, че ме има другаде де).
п.п.п Да бях написал и това а? <script type="text/javascript" src="js/jquery.js"></script>