I am working with Ian Li's Raphael SketchPad, and am having some trouble saving a drawing.
Upon changes on my sketchpad
an object with id data
is supposed to get updated, I placed a console log "changed" just to check. What happens is that upon loading the screen I see the console log message, and I don't see it again when changes are made.
How do I make the console.log run only after changes are made? Here is the extended code for the template I am using: https://gist.github.com/benbakhshi/5143484
<script type="text/javascript">
var sketchpad = Raphael.sketchpad("editor", {
height: 260,
width: 260,
editing: true // true is default
});
// When the sketchpad changes, update the input field.
sketchpad.change(function() {
$("#data").val(sketchpad.json());
console.log("changed");
});
</script>