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

sefiroths
  • 1,555
  • 3
  • 14
  • 29

2 Answers2

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.

Owen Hartnett
  • 5,925
  • 2
  • 19
  • 35
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.

Community
  • 1
  • 1
Srikar Appalaraju
  • 71,928
  • 54
  • 216
  • 264