api - Return status from webpurify javascript check method to main program -
i stuck in code.
i'm using webpurify(http://webpurify.com/) javascript api profanity checking. javascript api link here : http://webpurify.com/documentation/samples/javascript.php
i've made function..
function check() { $.webpurify.check( $("#check").val(), function(isprofane){ return isprofane; }); }
what function do.. whatever profanity checking status(isprofane value) generate, function should return value. but, here returning 'undefined'.
i don't know what's wrong going on this.
two guesses, 1 experience other jquery functions , other basic knowledge.
i think happens inside of function function(isprofane) stays inside of function function(isprofane), when return function(isprofane) nothing happens.
the other thing is, if isprofane never given value? isprofane? suppose value of #check ? @ least can't since you're not assigning it. variable undefined if it's value never given.
you should take closer @ documentation of .check function , how jquery functions work assigning variables , returning.
if want check() return isprofane you'd have after .check function, sakes of similar reasons mentioned first.
did you manage to solve this??
ReplyDeletecheers,
xmoderator.com