I have a server(desktop)-client(mobile) application. On the server side is generated the code for a web page in HTML with JavaScript and sent to client. Here the client fill some data in forms and submit the request(in the same page that were received from
server). The data are submited with JavaScript.
Now i have to get the input data and to change the requested values and submit further the data with JavaScript. I tried to use WebBrowser but with it is not possible to get the objects from form(document.*) and to execute the JavaScript.
example of JavaScript function that needs to be executed:
After some more test i find out that WebBrowser component executes actualy the full JavaScript the only thing is that when i used
webBrowser1.DocumentText = "some xhtml + javascript page using document.*(document.f_1.prBtn.value=i;)" it doesn't execute those lines but if you open the same page trough URI then it's executed everything ok.
Very strange behaviour, or maybe i didn't understood till the end the usage of webBrowser1.DocumentText.
Marked as answer by fant20 on Jun 24, 2011 11:19 AM
fant20
Member
15 Points
3 Posts
JavaScript execute on MobileDevice
Jun 20, 2011 06:57 AM|LINK
Hello all
I have a server(desktop)-client(mobile) application. On the server side is generated the code for a web page in HTML with JavaScript and sent to client. Here the client fill some data in forms and submit the request(in the same page that were received from server). The data are submited with JavaScript.
Now i have to get the input data and to change the requested values and submit further the data with JavaScript. I tried to use WebBrowser but with it is not possible to get the objects from form(document.*) and to execute the JavaScript.
example of JavaScript function that needs to be executed:
function onButtonPressed(i) {
document.f_1.prBtn.value=i;
document.f_1.submit();
}
How can be this done ?
I use VS2008 and CF3.5, WM5.0 and upper
Just compile it !
roopeshreddy
All-Star
20143 Points
3327 Posts
Re: JavaScript execute on MobileDevice
Jun 20, 2011 03:23 PM|LINK
Hi,
Try using WebBrowser Control in Forms for Windows Mobile Application. You can execute javascript!.
Check the following link for more information on Web Browser control.
http://msdn.microsoft.com/en-us/library/system.windows.forms.webbrowser(v=VS.90).aspx
Hope it helps u...
Roopesh Reddy C
Roopesh's Space
fant20
Member
15 Points
3 Posts
Re: JavaScript execute on MobileDevice
Jun 21, 2011 06:27 AM|LINK
yes, it executes JavaScript, but it doesn't execute the script that contains usage of the root "document.*" names, at least not for mobile devices.
fant20
Member
15 Points
3 Posts
Re: JavaScript execute on MobileDevice
Jun 24, 2011 11:19 AM|LINK
Hmm... i found the solution.
After some more test i find out that WebBrowser component executes actualy the full JavaScript the only thing is that when i used
webBrowser1.DocumentText = "some xhtml + javascript page using document.*(document.f_1.prBtn.value=i;)" it doesn't execute those lines but if you open the same page trough URI then it's executed everything ok.
Very strange behaviour, or maybe i didn't understood till the end the usage of webBrowser1.DocumentText.