Reputation: 93
I'm trying to build inplace editable elements and getting error Uncaught ReferenceError: $ is not defined
.
Here's my code
<div class="text-center">
<div class="col-sm-8 col-sm-offset-2">
<h2 class="title-one">Why With Us?</h2>
<p><a href ="#" id="details" data-type="text" data-pk="1" data-url="/post" data-original-title="Enter details">Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.<a>
<script>
$(function(){
$('#details').editable({
url: '/post',
title: 'Enter details'
});
});
</script></p>
</div>
</div>
I've included the mandatory files used in this code. Am I placing the script in wrong place? Please guide me.
Project link: http://noeticitservices.com/himu/
Thanks in advance.
Upvotes: 1
Views: 225
Reputation: 25373
This is because you do not have the jQuery library loaded.
jQuery (among other libraries) uses the $
global variable to namespace it's functionality.
Add this above your script tag which will download jQuery from it's CDN:
<script src="https://code.jquery.com/jquery-1.11.3.js"></script>
Upvotes: 1