With [NSURLConnection sendSynchronousRequest] method I get, with a GET request, a list of records from html page.
The records are paged at intervals of 20. To get the pages following the first, a function is called
javascript: GoToPagina (n)
where n is the number of page.
How can I call the function programmatically?
You need a
UIWebViewto do what you are asking about, as that is the only thing that can execute javascript on iOS. You can load it up with the URL in question, and when it’s done loading:However, in order to do it with
NSURLConnectiondirectly, you can’t use JS. Instead, forgure out what URL theGoToPagina(n)function gets its data from and call that directly with anotherNSURLConnection.If all you want is the data and you don’t want to show any webview at all, then this is more likely what you want to do.