locked
javascript on mobile device RRS feed

  • Question

  • User-952566608 posted

    Hi,

    I am develping a web based mobile application where I need to give the focus to a text box control on page load event. (barcode scanner will be used)

    I have noticed there is a solution as follows;

    <?XML:NAMESPACE PREFIX = MOBILE /><MOBILE:DEVICESPECIFIC runat="server"><MOBILE:DEVICESPECIFIC runat="server"><MOBILE:DEVICESPECIFIC id="Devicespecific2" runat="server">
    <CHOICE filter="isHTML32" xmlns="
    http://schemas.microsoft.com/mobile/html32template">
    <SCRIPTTEMPLATE>
    <SCRIPT language="javascript" for="window" event="onload()">document.Form1.txt_bc.focus(); 
    </SCRIPT>
    </SCRIPTTEMPLATE>
    </CHOICE>
    </MOBILE:DEVICESPECIFIC><CHOICE xmlns="http://schemas.microsoft.com/mobile/html32template" filter="isHTML32"><scriptTEMPLATE> <script language=javascript event=onload() for=window> document.Form1.txt_bc.focus(); </script> </SCRIPTTEMPLATE></CHOICE>
    </MOBILE:DEVICESPECIFIC><CHOICE xmlns="http://schemas.microsoft.com/mobile/html32template" filter="isHTML32"><scriptTEMPLATE> <script language=javascript event=onload() for=window> document.Form1.txt_bc.focus(); </script> </SCRIPTTEMPLATE></CHOICE></MOBILE:DEVICESPECIFIC><scriptTEMPLATE><scriptTEMPLATE><scriptTEMPLATE><scriptTEMPLATE>

    bu I could not run the java script for some reason,

    device is FALCON PSC 4220 and it comes with Windows CE .NET

    does java VM need to be installed? or is there another trick?

    Thanks for any help,

     

     

    Saturday, June 10, 2006 6:41 AM

All replies

  • User-1639143169 posted

    im not sure about that device specifically, but most mobile devices have none or limited javascript support, so it's probably not a great idea to rely on js scripts.

    if it's not generated by the asp.net runtime for mobile devices, i am not so comfortable using custom scripts and things, because you have to many different device types and options, you will never be able to properly test and support. unless you pick specific ones, like saying my app has "blackberry support" in your case, js is not by default there... as you can see you already hit a snag.

     

    Saturday, June 10, 2006 8:53 PM