I included jeditable in my existing webpage, $.editable is coming undefined

56 Views Asked by At

I included jeditable in my existing webpage.

$.editable is undefined.

I am not able to call or use the editable function to edit fields

What is the proper way to include jQuery plugins like this?

2

There are 2 best solutions below

0
Akshay Vijay Jain On BEST ANSWER

Actually i was facing issue adding many jquery plugins.
Problem is that I am working with Salesforce page, aura framework, so when adding script, the script is added in the head

I do not know how to control the loading order here, to jeditable.js gets loaded but because of some order mismatch it is not properly attached

That's why the error

Solution:
Now I am using $.getScript("address of jeditable uploaded to salesforce server")
and this is working fine

1
Dave On

Why $.editable? In manual you must use $(".some_element").editable().

Basic usage

<div class="edit" id="div_1">Dolor</div>
<div class="edit_area" id="div_2">Lorem ipsum dolor sit amet, consectetuer
adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore
magna aliquam erat volutpat.</div>

Javascript:

 $(document).ready(function() {
     $('.edit').editable('http://www.example.com/save.php');
 });

Please read more at documentation: http://www.appelsiini.net/projects/jeditable