Hi! You know on some websites that use php or AJAX to allow you to send information usually have a submit button? I was wondering how to allow Codea to send a virtual mouse click.
Thanks,
Prynok
Hi! You know on some websites that use php or AJAX to allow you to send information usually have a submit button? I was wondering how to allow Codea to send a virtual mouse click.
Thanks,
Prynok
There’s no way, unless your running a VM or executing PHP or JS or whatever their using in Codea. You can only get the HTML of the webpage.
@prynok if you want to simulate a mouse click from the ipad, not codea, then i remember seeing an app on the appstore that emulates a mouse in a browser. Dont remen
Ber the name though…
You don’t need to simulate the button.
The trick is to look at the source of the webpage (on your PC or mac) and figure out what URL the button calls when pressed, and what information it sends to the server. Then you can http.request it.
@ignatz good point. And you can look at the page code from your ipad too (some apps allow to see source code)
@Jmv38 why take an app if you can view it in safari?
just make a bookmark (i think it’s called like that)
then edit the javascript and paste this in
javascript:(function()%7Bvar%20d=window.open(%22about:blank%22),a=d.document;a.write(%22%3C!DOCTYPE%20html%3E%3Chtml%3E%3Chead%3E%3Ctitle%3ELoading%20Source%3C/title%3E%3C/head%3E%3Cbody%3E%3C/body%3E%3C/html%3E%22);a.close();var%20b=a.body.appendChild(a.createElement(%22form%22));b.setAttribute(%22method%22,%22post%22);b.setAttribute(%22action%22,%22http://ole.michelsen.dk/viewsource/?uri=%22+location.href);var%20c=b.appendChild(a.createElement(%22input%22));c.setAttribute(%22type%22,%22hidden%22);c.setAttribute(%22name%22,%22DOM%22);c.setAttribute(%22value%22,encodeURIComponent(document.documentElement.innerHTML));b.submit()%7D)()
then whenever you wanna view the source of a website, just click the bookmark when you’re on the page you wanna know the source off
@Jmv38 Wait, I thought if you got the data with http.request it gives you the source for any website, is that false?
@stevon8ter totally cool! Thanks! Do you have more in stock? =D>
@prynok you are right, but it might be difficult to interpret: depends on the encoding, etc…
@Jmv38 nope my box of tricks is empty now xD
but note that this isn’t my code, this is someone elses code…