jquery - Accessing functions from an external .js file -
this external .js file html.
html: li id="getphoto"
what's best way access function. can't work.
$(document).ready(function() { $('#getphoto').click(function() { function getphoto(source) { // retrieve image file location specified source navigator.camera.getpicture(onphotourisuccess, onfail, { quality: 50, destinationtype: destinationtype.file_uri, sourcetype: source }); } }); });
you don't have happening here. when click #getphoto, you're declaring getphoto()
function, not calling it. how call function.
$('#getphoto').click(function() { getphoto(somevar); }); function getphoto(source) { // retrieve image file location specified source navigator.camera.getpicture(onphotourisuccess, onfail, { quality: 50, destinationtype: destinationtype.file_uri, sourcetype: source }); }
that should set on right path.. looks might in on head.
Comments
Post a Comment