अलोहा संपादक दस्तावेज़ों के साथ आप अपने द्वारा उपयोग किए जा रहे किसी भी दृढ़ता तंत्र को डेटा सहेजने में मदद के लिए "अलोहा-स्मार्ट-कंटेंट-चेंज" ईवेंट के लिए सुन सकते हैं। यहां एक उदाहरण दिया गया है कि मैं क्या करने की कोशिश कर रहा हूं:अलोह संपादक "अलोह-स्मार्ट-कंटेंट-चेंज" इवेंट में सुनना?
<html>
<head>
<title>Aloha Event Testing</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script src="http://cdn.aloha-editor.org/current/lib/aloha.js" data-aloha-plugins="common/format, common/list, common/link, common/highlighteditables"></script>
<link href="http://cdn.aloha-editor.org/current/css/aloha.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
Aloha.ready(function() {
var $ = Aloha.jQuery;
$('.editable').aloha();
});
$(document).ready(function() {
$('.editable').bind('aloha-smart-content-changed', function() {
console.log('Aloha smart event handled.');
});
});
</script>
</head>
<body>
<div class="editable"></div>
</body>
</html>
लेकिन हैंडलर कभी आग नहीं लगाता है। क्या कोई भी जो अलोहा के साथ काम करता है, जानता है कि घटना के लिए उचित तरीके से कैसे सुनना है?
बिल्कुल सही में यह परीक्षण किया गया। अच्छा लगता है, अमीन, धन्यवाद! – mjswensen
वास्तविक सामग्री को प्राप्त करने के तरीके पर कोई विचार है? :/ – Populus
@ पोपुलस 'Aloha.getActiveEditable() प्राप्त करें। सामग्री प्राप्त करें(); '। – mjswensen