Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to remove any section of webpage before load it in UIWebView

    • 0
    • 1
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 4.19k
    Comment on it

    If we want to remove any section from webpage like header or footer than use the following code.

    In the following code header and footer.footer are the tag identifier of html Class.

    We have to use the appropriate tag of the control which we want to remove from the uiwebview.

    use the following delegate of uiwebview.

     

    - (void)webViewDidFinishLoad:(UIWebView *)webView {
        [webView stringByEvaluatingJavaScriptFromString:@"$(document).ready(function() { $('header').remove(); })"];
        [webView stringByEvaluatingJavaScriptFromString:@"$(document).ready(function() { $('footer.footer').remove(); })"];
    }

     

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: