Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9015359
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T03:43:56+00:00 2026-06-16T03:43:56+00:00

What I need to do is when I click a button or do a

  • 0

What I need to do is when I click a button or do a certain action, I want to have the webview transferred as if I have clicked on an href link the function should take the href id to know which link to go to.

Here’s what I have tried so far:

      [WebView stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:@"window.location.hash='%@'",footNoteNum]];
    float offsetX = [[WebView stringByEvaluatingJavaScriptFromString:@"window.pageXOffset"] floatValue];
    NSLog(@"offsetX %f", offsetX);
    int page = ceil(offsetX/748);

    page++;
    NSLog(@"page %i", page);
    [self scrollToPage:page];

But when webview is greater then 25 pages it starts giving wrong numbers for offsetX.

So I thought if I can do just like an href link that can be clicked dynamically so when I use the scrollbar it would take me to the right position in the webview.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T03:43:58+00:00Added an answer on June 16, 2026 at 3:43 am

    the way i have accomplished a similar problem (click on a particular tableView row and have it go to a specific location in a UIWebView in the same scene) is to embed anchors in the html, and then navigate straight to them. this assumes, of course, you have control over navigating to your footnotes in such a manner.

    the anchors just sit at each page in your html right before the text of each of your footnotes like this:

    <a name=footnote12>
    

    and then in your code, you would have:

        // baseURLForPageWithoutAnchor is the NSURL* for the page prior to going to any footnotes
    
        NSString* anchor = [@"#" stringByAppendingFormat:@"footnote%d", footNoteNum];
        NSString* baseForAnchor = baseURLForPageWithoutAnchor.absoluteString;
        NSURL* anchorURL = [NSURL URLWithString:[baseForAnchor stringByAppendingString:anchor]];
        [self.nestedWebView loadRequest:[NSURLRequest requestWithURL:anchorURL]];
    

    this will jump straight to the anchor, and the need for calculating the percentage into the UIWebView that you have been trying to scroll by percentage is eliminated.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have 3 layouts, I need when click on button access certain layout and
I have a hidden button on a form that I need to click in
Here i am calling a javascript function on a button click and i need
I need a function that a user can just click a flash app button
I have this certain viewmodel with viewmodels and collections. When I click save button
I need a click on the .next button in jQuery serialScroll/scrollTo to not only
Here i need to check a button click using javascript i.e)if button A is
In a web page button click event we need to export 2,00,000 to 5,00,000
I need a field to store some information after one asp button click for
When i click on OK button of an UIAlertView, i need to change the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.