Nette Ajax Error – Uncaught TypeError: Cannot read property ‚init‘
Upozornění: Tohle vlákno je hodně staré a informace nemusí být platné pro současné Nette.
- Piticu
- Člen | 93
Ahoj vsem,
snazim se nacist nette.ajax.js, ale porad se mi nedari a dostavam tenhle error:
jquery-3.2.1.js:3869 Uncaught TypeError: Cannot read property 'init' of undefined
at HTMLDocument.<anonymous> ((index):275)
at mightThrow (jquery-3.2.1.js:3583)
at process (jquery-3.2.1.js:3651)
Mate nejaky napad z jakydo duvodu? Pridavam @layout.latte
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" type="text/css" href="{$basePath}/bootstrap/css/bootstrap.min.css">
<link href="{$basePath}/form-helpers/css/bootstrap-formhelpers.min.css" rel="stylesheet">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="{$basePath}/css/styles.css">
<link rel="stylesheet" type="text/css" href="{$basePath}/css/forms.css">
<title>{ifset title}{include title|stripHtml} {/ifset} </title>
</head>
<body>....
{include content}
{block scripts}
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="http://code.jquery.com/jquery-3.2.1.js"></script>
<!-- jQuery UI -->
<script src="http://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="{$basePath}/bootstrap/js/bootstrap.min.js"></script>
<script src="{$basePath}/js/custom.js"></script>
<script src="{$basePath}/form-helpers/js/bootstrap-formhelpers.min.js"></script>
<script src="{$basePath}/js/forms.js"></script>
<script src="{$basePath}/js/tinymce/tinymce.min.js"></script>
<script src="{$basePath}/js/nette.ajax.js"></script>
............................
nette.init
$(function () {
$.nette.init();
});
nette.init jsem pridal az nakonec @layout.latte (pred </body) nebo hned za poslednim <script></script> nebo take v template a vubec nic