I’m using the webView:shouldStartLoadWithRequest:navigationType method to call my Objective-C code from JavaScript which works OK. The problem is, this method only gets called when a Web view reloads. I want to be able to send messages “whenever I want”. Is that possible?
Specifically I want to use document.location = "myapp:" + "customerAdded:" + "YES"; as often as I please. My code only gets executed when I draw the map using Google API V3.
Is it possible to reload an “invisible” frame in order to call the delegate method?
try this, works fine for me