0

i have a webpage with javascript that split the view into "pages" visible to the user:

    <!-- optionally include helper plugins -->
    <script type="text/javascript" language="javascript" src="js/jquery.mousewheel.min.js"></script>
    <script type="text/javascript" language="javascript" src="js/jquery.touchSwipe.min.js"></script>
    <script type="text/javascript" language="javascript" src="js/jquery.ba-throttle-debounce.min.js"></script>

i'm wondering if the app can know the page that is displayed...accessing some variables in the page or some other method to know it. i've not programmed the page, so i'm asking only if is conceptually possible or not, and what is a way to know what is happening to the page, driven by an event in the webpage thanks

2 Answers 2

1

Use the call stringByEvaluatingJavaScriptFromString: If you have a javascript method that will return the displayed page, you can use the above call to query the page and return the result.

Sign up to request clarification or add additional context in comments.

Comments

0

I am not sure of any direct way of doing this. Using some app specific custom url scheme is one wat. This answer comes close to answering your question - send a notification from javascript in UIWebView to ObjectiveC

I have also read somewhere about writing to NSLog from your javascript code, then iterate through that log and extract the commands and variables to be used by your Objective-C code. Never tried it.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.