Friday, April 1, 2011

[android-developers] Re: Call a WebView javascript function from the activity?

First, have you tried javascript:loadTOC() instead of javascript:loadTOC. You forgot the open and close braces.
 
Secondly, i'm not sure what your <script> does.
You want to execute an anonymous function when your document finished loading. This anonymous function just declares another function called loadTOC, which is never called. I'm getting a little rusty in JavaScript, but the scope of loadTOC does not seem to be global (it is local to that anonymous function).
Try to make this loadTOC function global by moving the 'function loadTOC() { ... }' outside of the anonymous function (and be sure to not forget the open and close braces in your Activity when calling loadTOC).
 

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate