Javascript embed during webViewDidStartLoad does not work on reboot

I am reloading my UIWebView, and for some reason, the code in stringByEvaluatingJavaScriptFromString does not seem to have an effect. It works great when loading the original image, but doesn't seem to work when rebooting. Coming through the debugger, I see that webViewDidStartLoad is called after a reboot, so there should be another problem.

- (void)webViewDidStartLoad:(UIWebView *)webView
{
    //pass in our default variables into the web view here
    [mainWebView stringByEvaluatingJavaScriptFromString:@"var model = {taskId:'xyz', foo:'bar'};"];

}

and my reboot method

- (void)refreshView{
    [mainWebView reload];   
}
+5
source share

All Articles