ошибка Uncaught TypeError: $(...)
Вложений: 1
Привет всем!
В чем может быть ошибка? Uncaught TypeError: $(...).Editor is not a function Перелопатил все что мог, не могу справиться.
<?php
include_once(ROOT . '/header.php');
?>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet">
<link href="css/editor.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="/template/css/adminpanel.css"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="js/editor.js" type="text/javascript" charset="utf-8"></script>
<br>
<div class="box">
<!-- Box Head -->
<div class="box-head">
<h2>Редагувати блог</h2>
</div>
<?php if (isset($blogItem)): ?>
<div class="form">
<form action="/adminpanel/blogedit/<?php echo $blogItem['id'] ?>" enctype="multipart/form-data"
method="post">
<!-- Form -->
<div class="container" style="padding:50px 0;">
<textarea id="txtedit"></textarea>
</div>
<script>
$('#txtedit').Editor();
</script>
<div class="buttons">
<input type="button" class="button" value="перегляд"/>
<input type="submit" name="edit_blog" class="button" value="опублікувати"/>
</div>
<?php else :
echo $res; ?>
</form>
<?php endif; ?>
</div>
</div>
<?php
include_once(ROOT . '/footer.php');
?>
PS. файл js у вложении |
wwwlopment,
строка 27
jQuery('#txtedit').Editor();
|
Цитата:
не сработало |
wwwlopment,
может js/editor.js путь неверный? |
wwwlopment,
проверяйте пути или ваши include
<?php
include_once(ROOT . '/header.php');
?>
<meta charset="utf-8">
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet">
<link href="https://cdn.rawgit.com/suyati/line-control/master//editor.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="/template/css/adminpanel.css"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="https://cdn.rawgit.com/suyati/line-control/master/editor.js"></script>
<br>
<div class="box">
<!-- Box Head -->
<div class="box-head">
<h2>Редагувати блог</h2>
</div>
<?php if (isset($blogItem)): ?>
<div class="form">
<form action="/adminpanel/blogedit/<?php echo $blogItem['id'] ?>" enctype="multipart/form-data"
method="post">
<!-- Form -->
<div class="container" style="padding:50px 0;">
<textarea id="txtedit"></textarea>
</div>
<script>
$('#txtedit').Editor();
</script>
<div class="buttons">
<input type="button" class="button" value="перегляд"/>
<input type="submit" name="edit_blog" class="button" value="опублікувати"/>
</div>
<?php else :
echo $res; ?>
</form>
<?php endif; ?>
</div>
</div>
<?php
include_once(ROOT . '/footer.php');
?>
|
все работает если ставлю простой html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet">
<link href="css/editor.css" rel="stylesheet">
</head>
<body>
<div class="container" style="padding:50px 0;">
<textarea id="txtedit"></textarea>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="js/editor.js"></script>
<script>
$('#txtedit').Editor();
</script>
</body>
</html>
|
wwwlopment,
возможно в header.php тоже есть скрипты, они возможно лишние |
Цитата:
Та же фигня. Вот подумал, не может ли мой .htaccess влиять? Код:
AddDefaultCharset utf-8 |
wwwlopment,
ждите специалистов по серверу |
Проблему решил :)
суть была в .htaccess Работающая конфа: Код:
AddDefaultCharset utf-8 |
| Часовой пояс GMT +3, время: 00:15. |