Java script memory leak

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jay

    Java script memory leak

    I have a web app running on the windows CE device. In one of the asp.net
    pages - it has javascript code. That seems to have a memory leak.
    When I run the web app - in about one hour, the app hangs. I looked at the
    memory and it seems to be full.
    I removed all the javascript code - and the app seems to be have no leaks.
    As soon as I include my javascript code - the memory consumption gradually
    increases.
    Whether I actually invoke the javascript code or not - it doesn't matter.
    The memory leak happens.

    I have been looking at some of the discussions around memory leak and they
    talk about circular references and closures.
    Well, I dont think I have that issue.
    What else can be the problem?

    Here is the page that has the problem:

    <%@ Master Language="C#" AutoEventWireup ="true" Inherits="MyMob ile"
    CodeBehind="MyM obile.master.cs " %>



    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">



    <html xmlns="http://www.w3.org/1999/xhtml" >

    <head id="Head1" runat="server">

    <title>Untitl ed Page</title>

    <meta http-equiv="ScannerN avigate"
    content="Javasc ript:onscan('%s ','%s','%s','%s ','%s');" />

    </head>

    <body onload="OnLoad( )" onbeforeunload= "showProgress() ;"
    onunload="sip_h ide();" onkeydown="canc elBack();">



    <% if (this.DisplayPr ogress && this.DisplayTim er)

    { %>

    <script language="javas cript" type="text/javascript" src="<%=
    Page.ResolveUrl ("~/Scripts/waitTimer.js") %>">

    </script>

    <% } %>

    <script language="javas cript" type="text/javascript" src="<%=
    Page.ResolveUrl ("~/Scripts/button.js") %>"></script>



    <script language="javas cript" type="text/javascript">

    var sipState = false;

    var isSubmitting = false; // limits page to only one Scan or Enter
    keypress, used by onkeydown method, injected via Basepage,
    HandleEnterKey( ...)



    function sip_hide()

    {

    // check if CE device

    if (navigator.appV ersion.indexOf( "Windows CE") >= 0)

    {

    external.CETerm .PostIDA( "IDA_SIP_HI DE", 0 );

    }

    }



    function sip_show()

    {

    // check if CE device

    if (navigator.appV ersion.indexOf( "Windows CE") >= 0)

    {

    external.CETerm .PostIDA( "IDA_SIP_SH OW", 0 );

    return false;

    }

    return false;

    }



    function sip_toggle()

    {

    if (sipState == false)

    {

    external.CETerm .PostIDA( "IDA_SIP_SH OW", 0 );

    sipState = true;

    return false;

    }

    else

    {

    external.CETerm .PostIDA( "IDA_SIP_HI DE", 0 );

    sipState = false;

    }

    }



    function showProgress()

    {

    <% if (this.DisplayPr ogress) { %>

    //added var since CSharp's bool in Script is

    // returned as True rather than true

    var bDisplayTimer = false;



    <% if (this.DisplayTi mer) { %>

    bDisplayTimer = true;

    <% } %>



    displayBusyPage (bDisplayTimer) ;



    <% } %>

    }



    function displayBusyPage (bTimerNeeded)

    {

    setTimeout('doc ument.images["<%= ProgressImage.C lientID
    %>"].src="<%= Page.ResolveUrl ("~/Images/progress.gif") %>"', 200);



    if (bTimerNeeded)

    setTimeout("Sta rtTimer()",10);



    document.getEle mentById('WaitS creen').style.d isplay ="block";

    document.getEle mentById('Conte nt').style.disp lay ="none";

    document.getEle mentById('appNa vSect').style.d isplay ="none";

    document.getEle mentById('globa lNavSect').styl e.display ="none";

    }



    // Scan Capture event

    function baseScanEvent(d ata,source,type ,time, length)

    {

    if (!isSubmitting) {

    theForm.<%= txtScannedData. ClientID %>.value = data;

    isSubmitting = true;

    external.CETerm .PostIDA( "IDA_SCAN_SUSPE ND", 0 );
    //turn off scanner, user experience, limit to one scan per submit

    theForm.submit( );

    }

    }



    var onScanEvent = function scanEvent(data, source,type,tim e, length)
    {

    baseScanEvent(d ata,source,type ,time, length);

    }



    function onscan(data, source, type, time, length)

    {

    // external.CETerm .PostIDA( "IDA_SCAN_SUSPE ND", 0 );

    var inputTypeElem = document.getEle mentById('<%=
    txtInputType.Cl ientID %>');

    inputTypeElem.v alue = 'S';

    var barcodeTypeElem = document.getEle mentById('<%=
    txtBarcodeType. ClientID %>');

    var btArray = source.split(': ');

    if (btArray.length 1)

    barcodeTypeElem .value = btArray[1];

    onScanEvent(dat a,source,type,t ime,length);

    }

    // End Scan Capture event



    // base Screen Load event - offers beep functionality

    function baseLoadEvent()

    {

    try

    {

    // For Beep(s) on Windows CE

    if (navigator.appV ersion.indexOf( "Windows CE") >= 0)

    {

    var count = <%= BeepCount %>;

    for(var i=1; i <= count; i++)

    {

    <%= BeepSoundPlaySt ring %>

    for(var j=1; j<=100000; j++);

    }

    }

    }

    catch (e)

    {

    alert(e.message );

    }

    }



    var onLoadEvent = function loadEvent() {

    baseLoadEvent() ;

    }

    //End screen OnLoad event



    // Scan Config event

    function baseScanConfigE vent()

    {

    try

    {

    // First Beep on Windows CE

    if (navigator.appV ersion.indexOf( "Windows CE") >= 0)

    {

    var sessIdx = external.sessio nindex;



    //check for any enabled symbologies

    var enabledSymbolog ies = "<%= this.EnabledSym bologies
    %>";

    if (external.CETer m.ActiveSession == 3) {

    if (enabledSymbolo gies == '') {

    external.CETerm .PostIDA(
    "IDA_SCAN_SUSPE ND", 0 );

    return;

    } else {

    external.CETerm .PostIDA(
    "IDA_SCAN_RESUM E", 0 );

    }

    }

    var symbologies =
    enabledSymbolog ies.split(",");



    // Disable all the common symbologies

    var allSymbologies = new
    Array("upca","u pce0","ean8","e an13","code39", "code128");

    for (var i=0; i < allSymbologies. length; i++) {

    external.CETerm .setProperty("s ession"+sessIdx +".scanner."+al lSymbologies[i]+".enabled",fal se);

    }



    // Enable the required symbologies

    for (var i=0; i < symbologies.len gth; i++) {

    external.CETerm .setProperty("s ession"+sessIdx +".scanner."+sy mbologies[i]+".enabled",tru e);

    }



    // Set the beeptime

    var beepTime = <%= BeepTime %>;

    external.CETerm .setProperty("s ession" + sessIdx +
    ".scanner.decod ebeeptime", beepTime);



    // Apply the settings

    external.CETerm .PostIDA(
    "IDA_SCAN_APPLY CONFIG", 0 );

    }

    }

    catch (e)

    {

    alert(e.message );

    }

    }



    var onScanConfig = function scanConfigEvent () {

    baseScanConfigE vent();

    }

    // End Scan Config event





    function OnLoad()

    {

    onLoadEvent();

    onScanConfig();

    }



    function disableSelectio n(target) {

    target.onselect start=function( ) {return false}

    }



    function cancelBack()

    {

    if ((event.keyCode == 8 ||

    (event.keyCode == 37 && event.altKey) ||

    (event.keyCode == 39 && event.altKey))

    &&

    (event.srcEleme nt.form == null || event.srcElemen t.isTextEdit
    == false)

    )

    {

    event.cancelBub ble = true;

    event.returnVal ue = false;

    }

    }



    //function to toggle alert icon to "active" status

    function alertRecdIcon () {

    try {

    document.getEle mentById('ctl00 _GlobalNavBarAr ea_GlobalNavAle rts').src="<%=
    Page.ResolveUrl ("~/Images/new_alert_recei ved.gif") %>";

    setCookie('MWN_ ALERT_ICON', '1', 1);

    } catch (e) {

    //ignore

    }

    }



    //function to toggle alert icon to "normal" status

    function alertNormalIcon () {

    try {

    document.getEle mentById('ctl00 _GlobalNavBarAr ea_GlobalNavAle rts').src="<%=
    Page.ResolveUrl ("~/Images/alert.jpg") %>";

    setCookie('MWN_ ALERT_ICON', '0', 1);

    } catch (e) {

    //ignore

    }

    }



    //function to handleAlert from listener app

    // handleAlert must exist to receive communications from the
    alerting listener client

    // the 'msg' argument carries the test message of the alert

    function handleAlert(typ e,priority,msg, id)

    {

    // all parameters ignored at this time

    // change below to the icon that would notify of a new alert

    alertRecdIcon() ;

    }



    // functions to set and get cookies -- used for alert icon state

    function setCookie(c_nam e,value,expired ays)

    {

    var exdate=new Date();

    exdate.setDate( exdate.getDate( )+expiredays);

    expiredays = null;

    document.cookie =c_name+ "=" +escape(value)+ "; path=/;
    domain=xyz.com; "+

    ((expiredays==n ull) ? "" : ";expires="+exd ate.toGMTString ());

    }



    function getCookie(c_nam e)

    {

    if (document.cooki e.length>0)

    {

    c_start=documen t.cookie.indexO f(c_name + "=");

    if (c_start!=-1)

    {

    c_start=c_start + c_name.length+1 ;

    c_end=document. cookie.indexOf( ";",c_start );

    if (c_end==-1) c_end=document. cookie.length;

    return unescape(docume nt.cookie.subst ring(c_start,c_ end));

    }

    }

    return "";

    }



    </script>



    <div id="MobileScree n" class="mobileSc reen">

    <form id="form1" runat="server">



    <input type="hidden" value="" name="txtScanne dData"
    id="txtScannedD ata" runat="server" />

    <input type="hidden" value="" name="txtBarcod eType"
    id="txtBarcodeT ype" runat="server" />

    <input type="hidden" value="K" name="txtInputT ype"
    id="txtInputTyp e" runat="server" />



    <div id="GlobalNavBa r"
    class="absGloba lNav">

    <asp:ContentPla ceHolder ID="GlobalNavBa rArea"
    runat="server">

    <div id="globalNavSe ct">

    <input type="image"
    name="element1" src="<%= Page.ResolveUrl ("~/Images/red1px.gif") %>"
    onclick="return false;"/>

    <asp:ImageButto n
    ID="GlobalNavHo me" runat="server" AlternateText=" Home"
    CssClass="globa lNavBtn1" ImageUrl="~/Images/home.jpg" Visible="false"
    OnClick="Global NavBarHome_Clic k" />

    <asp:ImageButto n
    ID="GlobalNavSc an" runat="server" AlternateText=" Scan"
    CssClass="globa lNavBtn2" ImageUrl="~/Images/scan.jpg" Visible="false"
    OnClick="Global NavBarScan_Clic k" />

    <asp:ImageButto n
    ID="GlobalNavTo ggle" runat="server" AlternateText=" Toggle"
    CssClass="globa lNavBtn2" ImageUrl="~/Images/toggle.jpg" Visible="false"
    OnClick="Global NavBarToggle_Cl ick" />

    <asp:ImageButto n
    ID="GlobalNavAl erts" runat="server" AlternateText=" Alerts"
    CssClass="globa lNavBtn3" ImageUrl="~/Images/alert.jpg" Visible="true"
    OnClientClick=" alertNormalIcon ();" OnClick="Global NavBarAlerts_Cl ick" />

    <asp:ImageButto n
    ID="GlobalNavIn fo" runat="server" AlternateText=" Info"
    CssClass="globa lNavBtn3" ImageUrl="~/Images/info.jpg" Visible="false"
    OnClick="Global NavBarInfo_Clic k" />

    <asp:ImageButto n
    ID="GlobalNavEx it" runat="server" AlternateText=" Exit"
    CssClass="globa lNavBtn4" ImageUrl="~/Images/exit.jpg" Visible="false"
    OnClick="Global NavBarExit_Clic k" />

    <asp:ImageButto n
    ID="GlobalNavKe yboard" runat="server" AlternateText=" Keyboard"
    CssClass="globa lNavBtn4" ImageUrl="~/Images/key.jpg" Visible="false"
    OnClientClick=" setFocusTxt();s ip_show();retur n false;" />

    <asp:ImageButto n
    ID="GlobalNavCh angeView" runat="server" AlternateText=" Change View"
    CssClass="globa lNavBtn4" ImageUrl="~/Images/change_view.jpg " Visible="false"
    OnClick="Global NavBarChangeVie w_Click" />

    </div>

    </asp:ContentPlac eHolder>

    </div>

    <div id="WaitScreen "
    class="absConte ntArea" style='display: none'>

    <table border="0" width="100%">

    <tr align="center">

    <td align="center">

    <asp:Image
    ID="ProgressIma ge" ImageAlign="abs middle" ImageUrl="~/Images/progress.gif"
    AlternateText=" In Progress" runat="server"/>

    <!--img
    id="ProgressIma ge" align=absmiddle src="/Images/progress.gif" alt="In
    Progress" /-->

    </td>

    </tr>

    <tr align="center"
    valign="top">

    <td align="center"
    valign="top">

    <font face="Tahoma"
    style="font-weight:bold" size="3"><%= BusyMessage %></font>

    <% if
    (this.DisplayTi mer) { %>

    <br /><br />

    <span id="time"
    class="waitTime r">

    &nbsp;&nbsp;

    </span>

    <% } %>

    </td>

    </tr>

    </table>

    </div>

    <div id="Content"
    class="absConte ntArea">

    <asp:ContentPla ceHolder ID="ContentArea " runat="server" >

    <h3>Default Content</h3>

    </asp:ContentPlac eHolder>

    </div>

    <div id="AppNavBar" class="appNav">

    <asp:ContentPla ceHolder ID="AppNavBarAr ea" runat="server">

    <div id="appNavSect" >

    <asp:ImageButto n ID="AppNavBarBa ck" runat="server"
    AlternateText=" Back" CssClass="appNa vBtn1" ImageUrl="~/Images/Back.jpg"
    Visible="false" OnClick="AppNav BarBack_Click" />

    <asp:ImageButto n ID="AppNavBarUp " runat="server"
    AlternateText=" Up" CssClass="appNa vBtn2" ImageUrl="~/Images/up.jpg"
    Visible="false" OnClick="AppNav BarUp_Click" />

    <asp:ImageButto n ID="AppNavBarDo wn" runat="server"
    AlternateText=" Down" CssClass="appNa vBtn3" ImageUrl="~/Images/down.jpg"
    Visible="false" OnClick="AppNav BarDown_Click" />

    <asp:ImageButto n ID="AppNavBarNe xt" runat="server"
    AlternateText=" Next" CssClass="appNa vBtn4" ImageUrl="~/Images/next.jpg"
    Visible="false" OnClick="AppNav BarNext_Click" />

    <asp:ImageButto n ID="AppNavBarGo " runat="server"
    AlternateText=" Go" CssClass="appNa vBtn4" ImageUrl="~/Images/go.gif"
    Visible="false" OnClick="AppNav BarGo_Click" />

    </div>

    </asp:ContentPlac eHolder>

    <div class="ScreenID "><asp:Labe l ID="lblScreenID "
    runat="server"> </asp:Label></div>

    </div>

    </form>



    <script language="javas cript" type="text/javascript">

    var theForm = document.forms['aspnetForm'];

    if (!theForm) {

    theForm = document.aspnet Form;

    }

    </script>



    </div>

    <script type="text/javascript" language="javas cript">

    disableSelectio n(document.getE lementById("Mob ileScreen"));



    //set alert icon based on cookie

    if (getCookie('MWN _ALERT_ICON')== '1') {

    alertRecdIcon() ;

    } else {

    alertNormalIcon ();

    }

    </script>

    </body>

    </html>


  • Michael Nemtsev [MVP]

    #2
    Re: Java script memory leak

    Hello Jay,

    it's definetely the JS leaking.
    I recommend to use these tools and try to detect where exactly it's leaking


    ---
    WBR,
    Michael Nemtsev [Microsoft MVP] :: blog: http://spaces.live.com/laflour

    "The greatest danger for most of us is not that our aim is too high and we
    miss it, but that it is too low and we reach it" (c) Michelangelo


    JI have a web app running on the windows CE device. In one of the
    Jasp.net
    Jpages - it has javascript code. That seems to have a memory leak.
    JWhen I run the web app - in about one hour, the app hangs. I looked
    Jat the
    Jmemory and it seems to be full.
    JI removed all the javascript code - and the app seems to be have no
    Jleaks.
    JAs soon as I include my javascript code - the memory consumption
    Jgradually
    Jincreases.
    JWhether I actually invoke the javascript code or not - it doesn't
    Jmatter.
    JThe memory leak happens.
    JI have been looking at some of the discussions around memory leak and
    Jthey
    Jtalk about circular references and closures.
    JWell, I dont think I have that issue.
    JWhat else can be the problem?
    JHere is the page that has the problem:
    J>
    J<%@ Master Language="C#" AutoEventWireup ="true" Inherits="MyMob ile"
    JCodeBehind="My Mobile.master.c s" %>
    J>
    J<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    J"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">
    J>
    J<html xmlns="http://www.w3.org/1999/xhtml" >
    J>
    J<head id="Head1" runat="server">
    J>
    J<title>Untitle d Page</title>
    J>
    J<meta http-equiv="ScannerN avigate"
    Jcontent="Javas cript:onscan('% s','%s','%s','% s','%s');" />
    J>
    J</head>
    J>
    J<body onload="OnLoad( )" onbeforeunload= "showProgress() ;"
    Jonunload="sip_ hide();" onkeydown="canc elBack();">
    J>
    J<% if (this.DisplayPr ogress && this.DisplayTim er)
    J>
    J{ %>
    J>
    J<script language="javas cript" type="text/javascript" src="<%=
    JPage.ResolveUr l("~/Scripts/waitTimer.js") %>">
    J>
    J</script>
    J>
    J<% } %>
    J>
    J<script language="javas cript" type="text/javascript" src="<%=
    JPage.ResolveUr l("~/Scripts/button.js") %>"></script>
    J>
    J<script language="javas cript" type="text/javascript">
    J>
    Jvar sipState = false;
    J>
    Jvar isSubmitting = false; // limits page to only one Scan or
    JEnter keypress, used by onkeydown method, injected via Basepage,
    JHandleEnterKey (...)
    J>
    Jfunction sip_hide()
    J>
    J{
    J>
    J// check if CE device
    J>
    Jif (navigator.appV ersion.indexOf( "Windows CE") >= 0)
    J>
    J{
    J>
    Jexternal.CETer m.PostIDA( "IDA_SIP_HI DE", 0 );
    J>
    J}
    J>
    J}
    J>
    Jfunction sip_show()
    J>
    J{
    J>
    J// check if CE device
    J>
    Jif (navigator.appV ersion.indexOf( "Windows CE") >= 0)
    J>
    J{
    J>
    Jexternal.CETer m.PostIDA( "IDA_SIP_SH OW", 0 );
    J>
    Jreturn false;
    J>
    J}
    J>
    Jreturn false;
    J>
    J}
    J>
    Jfunction sip_toggle()
    J>
    J{
    J>
    Jif (sipState == false)
    J>
    J{
    J>
    Jexternal.CETer m.PostIDA( "IDA_SIP_SH OW", 0 );
    J>
    JsipState = true;
    J>
    Jreturn false;
    J>
    J}
    J>
    Jelse
    J>
    J{
    J>
    Jexternal.CETer m.PostIDA( "IDA_SIP_HI DE", 0 );
    J>
    JsipState = false;
    J>
    J}
    J>
    J}
    J>
    Jfunction showProgress()
    J>
    J{
    J>
    J<% if (this.DisplayPr ogress) { %>
    J>
    J//added var since CSharp's bool in Script is
    J>
    J// returned as True rather than true
    J>
    Jvar bDisplayTimer = false;
    J>
    J<% if (this.DisplayTi mer) { %>
    J>
    JbDisplayTimer = true;
    J>
    J<% } %>
    J>
    JdisplayBusyPag e(bDisplayTimer );
    J>
    J<% } %>
    J>
    J}
    J>
    Jfunction displayBusyPage (bTimerNeeded)
    J>
    J{
    J>
    JsetTimeout('do cument.images["<%= ProgressImage.C lientID
    J%>"].src="<%= Page.ResolveUrl ("~/Images/progress.gif") %>"', 200);
    J>
    Jif (bTimerNeeded)
    J>
    JsetTimeout("St artTimer()",10) ;
    J>
    Jdocument.getEl ementById('Wait Screen').style. display
    J="block";
    J>
    Jdocument.getEl ementById('Cont ent').style.dis play ="none";
    J>
    Jdocument.getEl ementById('appN avSect').style. display
    J="none";
    J>
    Jdocument.getEl ementById('glob alNavSect').sty le.display
    J="none";
    J>
    J}
    J>
    J// Scan Capture event
    J>
    Jfunction baseScanEvent(d ata,source,type ,time, length)
    J>
    J{
    J>
    Jif (!isSubmitting) {
    J>
    JtheForm.<%= txtScannedData. ClientID %>.value = data;
    J>
    JisSubmitting = true;
    J>
    Jexternal.CETer m.PostIDA( "IDA_SCAN_SUSPE ND", 0 );
    J//turn off scanner, user experience, limit to one scan per submit
    J>
    JtheForm.submit ();
    J>
    J}
    J>
    J}
    J>
    Jvar onScanEvent = function scanEvent(data, source,type,tim e,
    Jlength) {
    J>
    JbaseScanEvent( data,source,typ e,time,
    Jlength);
    J>
    J}
    J>
    Jfunction onscan(data, source, type, time, length)
    J>
    J{
    J>
    J// external.CETerm .PostIDA( "IDA_SCAN_SUSPE ND", 0 );
    J>
    Jvar inputTypeElem = document.getEle mentById('<%=
    JtxtInputType.C lientID %>');
    J>
    JinputTypeElem. value = 'S';
    J>
    Jvar barcodeTypeElem = document.getEle mentById('<%=
    JtxtBarcodeType .ClientID %>');
    J>
    Jvar btArray = source.split(': ');
    J>
    Jif (btArray.length 1)
    J>
    JbarcodeTypeEle m.value = btArray[1];
    J>
    JonScanEvent(da ta,source,type, time,length);
    J>
    J}
    J>
    J// End Scan Capture event
    J>
    J// base Screen Load event - offers beep functionality
    J>
    Jfunction baseLoadEvent()
    J>
    J{
    J>
    Jtry
    J>
    J{
    J>
    J// For Beep(s) on Windows CE
    J>
    Jif (navigator.appV ersion.indexOf( "Windows CE") >= 0)
    J>
    J{
    J>
    Jvar count = <%= BeepCount %>;
    J>
    Jfor(var i=1; i <= count; i++)
    J>
    J{
    J>
    J<%= BeepSoundPlaySt ring %>
    J>
    Jfor(var j=1; j<=100000; j++);
    J>
    J}
    J>
    J}
    J>
    J}
    J>
    Jcatch (e)
    J>
    J{
    J>
    Jalert(e.messag e);
    J>
    J}
    J>
    J}
    J>
    Jvar onLoadEvent = function loadEvent() {
    J>
    JbaseLoadEvent( );
    J>
    J}
    J>
    J//End screen OnLoad event
    J>
    J// Scan Config event
    J>
    Jfunction baseScanConfigE vent()
    J>
    J{
    J>
    Jtry
    J>
    J{
    J>
    J// First Beep on Windows CE
    J>
    Jif (navigator.appV ersion.indexOf( "Windows CE") >= 0)
    J>
    J{
    J>
    Jvar sessIdx = external.sessio nindex;
    J>
    J//check for any enabled symbologies
    J>
    Jvar enabledSymbolog ies = "<%=
    Jthis.EnabledSy mbologies %>";
    J>
    Jif (external.CETer m.ActiveSession == 3) {
    J>
    Jif (enabledSymbolo gies == '')
    J{
    J>
    Jexternal.CETer m.PostIDA(
    J"IDA_SCAN_SUSP END", 0 );
    J>
    Jreturn;
    J>
    J} else {
    J>
    Jexternal.CETer m.PostIDA(
    J"IDA_SCAN_RESU ME", 0 );
    J>
    J}
    J>
    J}
    J>
    Jvar symbologies =
    JenabledSymbolo gies.split(",") ;
    J>
    J// Disable all the common symbologies
    J>
    Jvar allSymbologies = new
    JArray("upca"," upce0","ean8"," ean13","code39" ,"code128");
    J>
    Jfor (var i=0; i < allSymbologies. length; i++) {
    J>
    J>
    Jexternal.CETer m.setProperty(" session"+sessId x+".scanner."+a llSymbolog
    Jies[i]+".enabled",fal se);
    J>
    J}
    J>
    J// Enable the required
    Jsymbologies
    J>
    Jfor (var i=0; i < symbologies.len gth; i++) {
    J>
    J>
    Jexternal.CETer m.setProperty(" session"+sessId x+".scanner."+s ymbologies
    J[i]+".enabled",tru e);
    J>
    J}
    J>
    J// Set the beeptime
    J>
    Jvar beepTime = <%= BeepTime %>;
    J>
    Jexternal.CETer m.setProperty(" session" + sessIdx +
    J".scanner.deco debeeptime", beepTime);
    J>
    J// Apply the settings
    J>
    Jexternal.CETer m.PostIDA(
    J"IDA_SCAN_APPL YCONFIG", 0 );
    J>
    J}
    J>
    J}
    J>
    Jcatch (e)
    J>
    J{
    J>
    Jalert(e.messag e);
    J>
    J}
    J>
    J}
    J>
    Jvar onScanConfig = function scanConfigEvent () {
    J>
    JbaseScanConfig Event();
    J>
    J}
    J>
    J// End Scan Config event
    J>
    Jfunction OnLoad()
    J>
    J{
    J>
    JonLoadEvent();
    J>
    JonScanConfig() ;
    J>
    J}
    J>
    Jfunction disableSelectio n(target) {
    J>
    Jtarget.onselec tstart=function () {return false}
    J>
    J}
    J>
    Jfunction cancelBack()
    J>
    J{
    J>
    Jif ((event.keyCode == 8 ||
    J>
    J(event.keyCode == 37 && event.altKey) ||
    J>
    J(event.keyCode == 39 && event.altKey))
    J>
    J&&
    J>
    J(event.srcElem ent.form == null ||
    Jevent.srcEleme nt.isTextEdit == false)
    J>
    J)
    J>
    J{
    J>
    Jevent.cancelBu bble = true;
    J>
    Jevent.returnVa lue = false;
    J>
    J}
    J>
    J}
    J>
    J//function to toggle alert icon to "active" status
    J>
    Jfunction alertRecdIcon () {
    J>
    Jtry {
    J>
    J>
    Jdocument.getEl ementById('ctl0 0_GlobalNavBarA rea_GlobalNavAl erts').src
    J="<%= Page.ResolveUrl ("~/Images/new_alert_recei ved.gif") %>";
    J>
    JsetCookie('MWN _ALERT_ICON', '1', 1);
    J>
    J} catch (e) {
    J>
    J//ignore
    J>
    J}
    J>
    J}
    J>
    J//function to toggle alert icon to "normal" status
    J>
    Jfunction alertNormalIcon () {
    J>
    Jtry {
    J>
    J>
    Jdocument.getEl ementById('ctl0 0_GlobalNavBarA rea_GlobalNavAl erts').src
    J="<%= Page.ResolveUrl ("~/Images/alert.jpg") %>";
    J>
    JsetCookie('MWN _ALERT_ICON', '0', 1);
    J>
    J} catch (e) {
    J>
    J//ignore
    J>
    J}
    J>
    J}
    J>
    J//function to handleAlert from listener app
    J>
    J// handleAlert must exist to receive communications from the
    Jalerting listener client
    J>
    J// the 'msg' argument carries the test message of the alert
    J>
    Jfunction handleAlert(typ e,priority,msg, id)
    J>
    J{
    J>
    J// all parameters ignored at this time
    J>
    J// change below to the icon that would notify of a new
    Jalert
    J>
    JalertRecdIcon( );
    J>
    J}
    J>
    J// functions to set and get cookies -- used for alert icon
    Jstate
    J>
    Jfunction setCookie(c_nam e,value,expired ays)
    J>
    J{
    J>
    Jvar exdate=new Date();
    J>
    Jexdate.setDate (exdate.getDate ()+expiredays);
    J>
    Jexpiredays = null;
    J>
    Jdocument.cooki e=c_name+ "=" +escape(value)+ "; path=/;
    Jdomain=xyz.com ;"+
    J>
    J((expiredays== null) ? "" :
    J";expires="+ex date.toGMTStrin g());
    J>
    J}
    J>
    Jfunction getCookie(c_nam e)
    J>
    J{
    J>
    Jif (document.cooki e.length>0)
    J>
    J{
    J>
    Jc_start=docume nt.cookie.index Of(c_name + "=");
    J>
    Jif (c_start!=-1)
    J>
    J{
    J>
    Jc_start=c_star t + c_name.length+1 ;
    J>
    Jc_end=document .cookie.indexOf (";",c_start );
    J>
    Jif (c_end==-1) c_end=document. cookie.length;
    J>
    Jreturn
    Junescape(docum ent.cookie.subs tring(c_start,c _end));
    J>
    J}
    J>
    J}
    J>
    Jreturn "";
    J>
    J}
    J>
    J</script>
    J>
    J<div id="MobileScree n" class="mobileSc reen">
    J>
    J<form id="form1" runat="server">
    J>
    J<input type="hidden" value="" name="txtScanne dData"
    Jid="txtScanned Data" runat="server" />
    J>
    J<input type="hidden" value="" name="txtBarcod eType"
    Jid="txtBarcode Type" runat="server" />
    J>
    J<input type="hidden" value="K" name="txtInputT ype"
    Jid="txtInputTy pe" runat="server" />
    J>
    J<div id="GlobalNavBa r"
    Jclass="absGlob alNav">
    J>
    J<asp:ContentPl aceHolder ID="GlobalNavBa rArea"
    Jrunat="server" >
    J>
    J<div id="globalNavSe ct">
    J>
    J<input
    Jtype="image" name="element1" src="<%=
    JPage.ResolveUr l("~/Images/red1px.gif") %>" onclick="return false;"/>
    J>
    J<asp:ImageButt on
    JID="GlobalNavH ome" runat="server" AlternateText=" Home"
    JCssClass="glob alNavBtn1" ImageUrl="~/Images/home.jpg" Visible="false"
    JOnClick="Globa lNavBarHome_Cli ck" />
    J>
    J>
    J<asp:ImageButt on ID="GlobalNavSc an" runat="server"
    JAlternateText= "Scan" CssClass="globa lNavBtn2"
    JImageUrl="~/Images/scan.jpg" Visible="false"
    JOnClick="Globa lNavBarScan_Cli ck" />
    J>
    J>
    J<asp:ImageButt on ID="GlobalNavTo ggle" runat="server"
    JAlternateText= "Toggle" CssClass="globa lNavBtn2"
    JImageUrl="~/Images/toggle.jpg" Visible="false"
    JOnClick="Globa lNavBarToggle_C lick" />
    J>
    J>
    J<asp:ImageButt on ID="GlobalNavAl erts" runat="server"
    JAlternateText= "Alerts" CssClass="globa lNavBtn3"
    JImageUrl="~/Images/alert.jpg" Visible="true"
    JOnClientClick= "alertNormalIco n();" OnClick="Global NavBarAlerts_Cl ick"
    J/>
    J>
    J>
    J<asp:ImageButt on ID="GlobalNavIn fo" runat="server"
    JAlternateText= "Info" CssClass="globa lNavBtn3"
    JImageUrl="~/Images/info.jpg" Visible="false"
    JOnClick="Globa lNavBarInfo_Cli ck" />
    J>
    J>
    J<asp:ImageButt on ID="GlobalNavEx it" runat="server"
    JAlternateText= "Exit" CssClass="globa lNavBtn4"
    JImageUrl="~/Images/exit.jpg" Visible="false"
    JOnClick="Globa lNavBarExit_Cli ck" />
    J>
    J>
    J<asp:ImageButt on ID="GlobalNavKe yboard" runat="server"
    JAlternateText= "Keyboard" CssClass="globa lNavBtn4"
    JImageUrl="~/Images/key.jpg" Visible="false"
    JOnClientClick= "setFocusTxt(); sip_show();retu rn false;" />
    J>
    J>
    J<asp:ImageButt on ID="GlobalNavCh angeView" runat="server"
    JAlternateText= "Change View" CssClass="globa lNavBtn4"
    JImageUrl="~/Images/change_view.jpg " Visible="false"
    JOnClick="Globa lNavBarChangeVi ew_Click" />
    J>
    J</div>
    J>
    J</asp:ContentPlac eHolder>
    J>
    J</div>
    J>
    J<div id="WaitScreen "
    Jclass="absCont entArea" style='display: none'>
    J>
    J<table border="0"
    Jwidth="100%">
    J>
    J<tr align="center">
    J>
    J<td align="center">
    J>
    J<asp:Image
    JID="ProgressIm age" ImageAlign="abs middle"
    JImageUrl="~/Images/progress.gif" AlternateText=" In Progress"
    Jrunat="server"/>
    J>
    J<!--img
    Jid="ProgressIm age" align=absmiddle src="/Images/progress.gif" alt="In
    JProgress" /-->
    J>
    J</td>
    J>
    J</tr>
    J>
    J<tr align="center"
    Jvalign="top">
    J>
    J<td align="center"
    Jvalign="top">
    J>
    J<font
    Jface="Tahoma" style="font-weight:bold" size="3"><%= BusyMessage
    J%></font>
    J>
    J<% if
    J(this.DisplayT imer) { %>
    J>
    J<br /><br />
    J>
    J<span
    Jid="time" class="waitTime r">
    J>
    J&nbsp;&nbsp;
    J>
    J</span>
    J>
    J<% } %>
    J>
    J</td>
    J>
    J</tr>
    J>
    J</table>
    J>
    J</div>
    J>
    J<div id="Content"
    Jclass="absCont entArea">
    J>
    J<asp:ContentPl aceHolder ID="ContentArea "
    Jrunat="server" >
    J>
    J<h3>Default Content</h3>
    J>
    J</asp:ContentPlac eHolder>
    J>
    J</div>
    J>
    J<div id="AppNavBar"
    Jclass="appNav" >
    J>
    J<asp:ContentPl aceHolder ID="AppNavBarAr ea"
    Jrunat="server" >
    J>
    J<div id="appNavSect" >
    J>
    J<asp:ImageButt on ID="AppNavBarBa ck"
    Jrunat="server" AlternateText=" Back" CssClass="appNa vBtn1"
    JImageUrl="~/Images/Back.jpg" Visible="false"
    JOnClick="AppNa vBarBack_Click" />
    J>
    J<asp:ImageButt on ID="AppNavBarUp " runat="server"
    JAlternateText= "Up" CssClass="appNa vBtn2" ImageUrl="~/Images/up.jpg"
    JVisible="false " OnClick="AppNav BarUp_Click" />
    J>
    J<asp:ImageButt on ID="AppNavBarDo wn"
    Jrunat="server" AlternateText=" Down" CssClass="appNa vBtn3"
    JImageUrl="~/Images/down.jpg" Visible="false"
    JOnClick="AppNa vBarDown_Click" />
    J>
    J<asp:ImageButt on ID="AppNavBarNe xt"
    Jrunat="server" AlternateText=" Next" CssClass="appNa vBtn4"
    JImageUrl="~/Images/next.jpg" Visible="false"
    JOnClick="AppNa vBarNext_Click" />
    J>
    J<asp:ImageButt on ID="AppNavBarGo " runat="server"
    JAlternateText= "Go" CssClass="appNa vBtn4" ImageUrl="~/Images/go.gif"
    JVisible="false " OnClick="AppNav BarGo_Click" />
    J>
    J</div>
    J>
    J</asp:ContentPlac eHolder>
    J>
    J<div class="ScreenID "><asp:Labe l ID="lblScreenID "
    Jrunat="server" ></asp:Label></div>
    J>
    J</div>
    J>
    J</form>
    J>
    J<script language="javas cript"
    Jtype="text/javascript">
    J>
    Jvar theForm = document.forms['aspnetForm'];
    J>
    Jif (!theForm) {
    J>
    JtheForm = document.aspnet Form;
    J>
    J}
    J>
    J</script>
    J>
    J</div>
    J>
    J<script type="text/javascript" language="javas cript">
    J>
    JdisableSelecti on(document.get ElementById("Mo bileScreen"));
    J>
    J//set alert icon based on cookie
    J>
    Jif (getCookie('MWN _ALERT_ICON')== '1') {
    J>
    JalertRecdIcon( );
    J>
    J} else {
    J>
    JalertNormalIco n();
    J>
    J}
    J>
    J</script>
    J>
    J</body>
    J>
    J</html>
    J>


    Comment

    • Alvin Bruney [ASP.NET MVP]

      #3
      Re: Java script memory leak

      How do you stop the timer, I don't see it in the code.

      --

      Regards,
      Alvin Bruney [MVP ASP.NET]

      [Shameless Author plug]
      The O.W.C. Black Book, 2nd Edition
      Exclusively on www.lulu.com/owc $19.99
      -------------------------------------------------------


      "Jay" <jay@microsoft. comwrote in message
      news:#PI$jbA0IH A.2408@TK2MSFTN GP04.phx.gbl...
      I have a web app running on the windows CE device. In one of the asp.net
      pages - it has javascript code. That seems to have a memory leak.
      When I run the web app - in about one hour, the app hangs. I looked at the
      memory and it seems to be full.
      I removed all the javascript code - and the app seems to be have no leaks.
      As soon as I include my javascript code - the memory consumption gradually
      increases.
      Whether I actually invoke the javascript code or not - it doesn't matter.
      The memory leak happens.
      >
      I have been looking at some of the discussions around memory leak and they
      talk about circular references and closures.
      Well, I dont think I have that issue.
      What else can be the problem?
      >
      Here is the page that has the problem:
      >
      <%@ Master Language="C#" AutoEventWireup ="true" Inherits="MyMob ile"
      CodeBehind="MyM obile.master.cs " %>
      >
      >
      >
      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">
      >
      >
      >
      <html xmlns="http://www.w3.org/1999/xhtml" >
      >
      <head id="Head1" runat="server">
      >
      <title>Untitl ed Page</title>
      >
      <meta http-equiv="ScannerN avigate"
      content="Javasc ript:onscan('%s ','%s','%s','%s ','%s');" />
      >
      </head>
      >
      <body onload="OnLoad( )" onbeforeunload= "showProgress() ;"
      onunload="sip_h ide();" onkeydown="canc elBack();">
      >
      >
      >
      <% if (this.DisplayPr ogress && this.DisplayTim er)
      >
      { %>
      >
      <script language="javas cript" type="text/javascript" src="<%=
      Page.ResolveUrl ("~/Scripts/waitTimer.js") %>">
      >
      </script>
      >
      <% } %>
      >
      <script language="javas cript" type="text/javascript" src="<%=
      Page.ResolveUrl ("~/Scripts/button.js") %>"></script>
      >
      >
      >
      <script language="javas cript" type="text/javascript">
      >
      var sipState = false;
      >
      var isSubmitting = false; // limits page to only one Scan or Enter
      keypress, used by onkeydown method, injected via Basepage,
      HandleEnterKey( ...)
      >
      >
      >
      function sip_hide()
      >
      {
      >
      // check if CE device
      >
      if (navigator.appV ersion.indexOf( "Windows CE") >= 0)
      >
      {
      >
      external.CETerm .PostIDA( "IDA_SIP_HI DE", 0 );
      >
      }
      >
      }
      >
      >
      >
      function sip_show()
      >
      {
      >
      // check if CE device
      >
      if (navigator.appV ersion.indexOf( "Windows CE") >= 0)
      >
      {
      >
      external.CETerm .PostIDA( "IDA_SIP_SH OW", 0 );
      >
      return false;
      >
      }
      >
      return false;
      >
      }
      >
      >
      >
      function sip_toggle()
      >
      {
      >
      if (sipState == false)
      >
      {
      >
      external.CETerm .PostIDA( "IDA_SIP_SH OW", 0 );
      >
      sipState = true;
      >
      return false;
      >
      }
      >
      else
      >
      {
      >
      external.CETerm .PostIDA( "IDA_SIP_HI DE", 0 );
      >
      sipState = false;
      >
      }
      >
      }
      >
      >
      >
      function showProgress()
      >
      {
      >
      <% if (this.DisplayPr ogress) { %>
      >
      //added var since CSharp's bool in Script is
      >
      // returned as True rather than true
      >
      var bDisplayTimer = false;
      >
      >
      >
      <% if (this.DisplayTi mer) { %>
      >
      bDisplayTimer = true;
      >
      <% } %>
      >
      >
      >
      displayBusyPage (bDisplayTimer) ;
      >
      >
      >
      <% } %>
      >
      }
      >
      >
      >
      function displayBusyPage (bTimerNeeded)
      >
      {
      >
      setTimeout('doc ument.images["<%= ProgressImage.C lientID
      %>"].src="<%= Page.ResolveUrl ("~/Images/progress.gif") %>"', 200);
      >
      >
      >
      if (bTimerNeeded)
      >
      setTimeout("Sta rtTimer()",10);
      >
      >
      >
      document.getEle mentById('WaitS creen').style.d isplay ="block";
      >
      document.getEle mentById('Conte nt').style.disp lay ="none";
      >
      document.getEle mentById('appNa vSect').style.d isplay ="none";
      >
      document.getEle mentById('globa lNavSect').styl e.display ="none";
      >
      }
      >
      >
      >
      // Scan Capture event
      >
      function baseScanEvent(d ata,source,type ,time, length)
      >
      {
      >
      if (!isSubmitting) {
      >
      theForm.<%= txtScannedData. ClientID %>.value = data;
      >
      isSubmitting = true;
      >
      external.CETerm .PostIDA( "IDA_SCAN_SUSPE ND", 0 ); //turn
      off scanner, user experience, limit to one scan per submit
      >
      theForm.submit( );
      >
      }
      >
      }
      >
      >
      >
      var onScanEvent = function scanEvent(data, source,type,tim e, length)
      {
      >
      baseScanEvent(d ata,source,type ,time, length);
      >
      }
      >
      >
      >
      function onscan(data, source, type, time, length)
      >
      {
      >
      // external.CETerm .PostIDA( "IDA_SCAN_SUSPE ND", 0 );
      >
      var inputTypeElem = document.getEle mentById('<%=
      txtInputType.Cl ientID %>');
      >
      inputTypeElem.v alue = 'S';
      >
      var barcodeTypeElem = document.getEle mentById('<%=
      txtBarcodeType. ClientID %>');
      >
      var btArray = source.split(': ');
      >
      if (btArray.length 1)
      >
      barcodeTypeElem .value = btArray[1];
      >
      onScanEvent(dat a,source,type,t ime,length);
      >
      }
      >
      // End Scan Capture event
      >
      >
      >
      // base Screen Load event - offers beep functionality
      >
      function baseLoadEvent()
      >
      {
      >
      try
      >
      {
      >
      // For Beep(s) on Windows CE
      >
      if (navigator.appV ersion.indexOf( "Windows CE") >= 0)
      >
      {
      >
      var count = <%= BeepCount %>;
      >
      for(var i=1; i <= count; i++)
      >
      {
      >
      <%= BeepSoundPlaySt ring %>
      >
      for(var j=1; j<=100000; j++);
      >
      }
      >
      }
      >
      }
      >
      catch (e)
      >
      {
      >
      alert(e.message );
      >
      }
      >
      }
      >
      >
      >
      var onLoadEvent = function loadEvent() {
      >
      baseLoadEvent() ;
      >
      }
      >
      //End screen OnLoad event
      >
      >
      >
      // Scan Config event
      >
      function baseScanConfigE vent()
      >
      {
      >
      try
      >
      {
      >
      // First Beep on Windows CE
      >
      if (navigator.appV ersion.indexOf( "Windows CE") >= 0)
      >
      {
      >
      var sessIdx = external.sessio nindex;
      >
      >
      >
      //check for any enabled symbologies
      >
      var enabledSymbolog ies = "<%= this.EnabledSym bologies
      %>";
      >
      if (external.CETer m.ActiveSession == 3) {
      >
      if (enabledSymbolo gies == '') {
      >
      external.CETerm .PostIDA(
      "IDA_SCAN_SUSPE ND", 0 );
      >
      return;
      >
      } else {
      >
      external.CETerm .PostIDA(
      "IDA_SCAN_RESUM E", 0 );
      >
      }
      >
      }
      >
      var symbologies =
      enabledSymbolog ies.split(",");
      >
      >
      >
      // Disable all the common symbologies
      >
      var allSymbologies = new
      Array("upca","u pce0","ean8","e an13","code39", "code128");
      >
      for (var i=0; i < allSymbologies. length; i++) {
      >
      >
      external.CETerm .setProperty("s ession"+sessIdx +".scanner."+al lSymbologies[i]+".enabled",fal se);
      >
      }
      >
      >
      >
      // Enable the required symbologies
      >
      for (var i=0; i < symbologies.len gth; i++) {
      >
      >
      external.CETerm .setProperty("s ession"+sessIdx +".scanner."+sy mbologies[i]+".enabled",tru e);
      >
      }
      >
      >
      >
      // Set the beeptime
      >
      var beepTime = <%= BeepTime %>;
      >
      external.CETerm .setProperty("s ession" + sessIdx +
      ".scanner.decod ebeeptime", beepTime);
      >
      >
      >
      // Apply the settings
      >
      external.CETerm .PostIDA(
      "IDA_SCAN_APPLY CONFIG", 0 );
      >
      }
      >
      }
      >
      catch (e)
      >
      {
      >
      alert(e.message );
      >
      }
      >
      }
      >
      >
      >
      var onScanConfig = function scanConfigEvent () {
      >
      baseScanConfigE vent();
      >
      }
      >
      // End Scan Config event
      >
      >
      >
      >
      >
      function OnLoad()
      >
      {
      >
      onLoadEvent();
      >
      onScanConfig();
      >
      }
      >
      >
      >
      function disableSelectio n(target) {
      >
      target.onselect start=function( ) {return false}
      >
      }
      >
      >
      >
      function cancelBack()
      >
      {
      >
      if ((event.keyCode == 8 ||
      >
      (event.keyCode == 37 && event.altKey) ||
      >
      (event.keyCode == 39 && event.altKey))
      >
      &&
      >
      (event.srcEleme nt.form == null ||
      event.srcElemen t.isTextEdit == false)
      >
      )
      >
      {
      >
      event.cancelBub ble = true;
      >
      event.returnVal ue = false;
      >
      }
      >
      }
      >
      >
      >
      //function to toggle alert icon to "active" status
      >
      function alertRecdIcon () {
      >
      try {
      >
      >
      document.getEle mentById('ctl00 _GlobalNavBarAr ea_GlobalNavAle rts').src="<%=
      Page.ResolveUrl ("~/Images/new_alert_recei ved.gif") %>";
      >
      setCookie('MWN_ ALERT_ICON', '1', 1);
      >
      } catch (e) {
      >
      //ignore
      >
      }
      >
      }
      >
      >
      >
      //function to toggle alert icon to "normal" status
      >
      function alertNormalIcon () {
      >
      try {
      >
      >
      document.getEle mentById('ctl00 _GlobalNavBarAr ea_GlobalNavAle rts').src="<%=
      Page.ResolveUrl ("~/Images/alert.jpg") %>";
      >
      setCookie('MWN_ ALERT_ICON', '0', 1);
      >
      } catch (e) {
      >
      //ignore
      >
      }
      >
      }
      >
      >
      >
      //function to handleAlert from listener app
      >
      // handleAlert must exist to receive communications from the
      alerting listener client
      >
      // the 'msg' argument carries the test message of the alert
      >
      function handleAlert(typ e,priority,msg, id)
      >
      {
      >
      // all parameters ignored at this time
      >
      // change below to the icon that would notify of a new alert
      >
      alertRecdIcon() ;
      >
      }
      >
      >
      >
      // functions to set and get cookies -- used for alert icon state
      >
      function setCookie(c_nam e,value,expired ays)
      >
      {
      >
      var exdate=new Date();
      >
      exdate.setDate( exdate.getDate( )+expiredays);
      >
      expiredays = null;
      >
      document.cookie =c_name+ "=" +escape(value)+ "; path=/;
      domain=xyz.com; "+
      >
      ((expiredays==n ull) ? "" : ";expires="+exd ate.toGMTString ());
      >
      }
      >
      >
      >
      function getCookie(c_nam e)
      >
      {
      >
      if (document.cooki e.length>0)
      >
      {
      >
      c_start=documen t.cookie.indexO f(c_name + "=");
      >
      if (c_start!=-1)
      >
      {
      >
      c_start=c_start + c_name.length+1 ;
      >
      c_end=document. cookie.indexOf( ";",c_start );
      >
      if (c_end==-1) c_end=document. cookie.length;
      >
      return unescape(docume nt.cookie.subst ring(c_start,c_ end));
      >
      }
      >
      }
      >
      return "";
      >
      }
      >
      >
      >
      </script>
      >
      >
      >
      <div id="MobileScree n" class="mobileSc reen">
      >
      <form id="form1" runat="server">
      >
      >
      >
      <input type="hidden" value="" name="txtScanne dData"
      id="txtScannedD ata" runat="server" />
      >
      <input type="hidden" value="" name="txtBarcod eType"
      id="txtBarcodeT ype" runat="server" />
      >
      <input type="hidden" value="K" name="txtInputT ype"
      id="txtInputTyp e" runat="server" />
      >
      >
      >
      <div id="GlobalNavBa r"
      class="absGloba lNav">
      >
      <asp:ContentPla ceHolder ID="GlobalNavBa rArea"
      runat="server">
      >
      <div id="globalNavSe ct">
      >
      <input type="image"
      name="element1" src="<%= Page.ResolveUrl ("~/Images/red1px.gif") %>"
      onclick="return false;"/>
      >
      <asp:ImageButto n
      ID="GlobalNavHo me" runat="server" AlternateText=" Home"
      CssClass="globa lNavBtn1" ImageUrl="~/Images/home.jpg" Visible="false"
      OnClick="Global NavBarHome_Clic k" />
      >
      >
      <asp:ImageButto n ID="GlobalNavSc an" runat="server" AlternateText=" Scan"
      CssClass="globa lNavBtn2" ImageUrl="~/Images/scan.jpg" Visible="false"
      OnClick="Global NavBarScan_Clic k" />
      >
      >
      <asp:ImageButto n ID="GlobalNavTo ggle" runat="server"
      AlternateText=" Toggle" CssClass="globa lNavBtn2"
      ImageUrl="~/Images/toggle.jpg" Visible="false"
      OnClick="Global NavBarToggle_Cl ick" />
      >
      >
      <asp:ImageButto n ID="GlobalNavAl erts" runat="server"
      AlternateText=" Alerts" CssClass="globa lNavBtn3"
      ImageUrl="~/Images/alert.jpg" Visible="true"
      OnClientClick=" alertNormalIcon ();" OnClick="Global NavBarAlerts_Cl ick" />
      >
      >
      <asp:ImageButto n ID="GlobalNavIn fo" runat="server" AlternateText=" Info"
      CssClass="globa lNavBtn3" ImageUrl="~/Images/info.jpg" Visible="false"
      OnClick="Global NavBarInfo_Clic k" />
      >
      >
      <asp:ImageButto n ID="GlobalNavEx it" runat="server" AlternateText=" Exit"
      CssClass="globa lNavBtn4" ImageUrl="~/Images/exit.jpg" Visible="false"
      OnClick="Global NavBarExit_Clic k" />
      >
      >
      <asp:ImageButto n ID="GlobalNavKe yboard" runat="server"
      AlternateText=" Keyboard" CssClass="globa lNavBtn4"
      ImageUrl="~/Images/key.jpg" Visible="false"
      OnClientClick=" setFocusTxt();s ip_show();retur n false;" />
      >
      >
      <asp:ImageButto n ID="GlobalNavCh angeView" runat="server"
      AlternateText=" Change View" CssClass="globa lNavBtn4"
      ImageUrl="~/Images/change_view.jpg " Visible="false"
      OnClick="Global NavBarChangeVie w_Click" />
      >
      </div>
      >
      </asp:ContentPlac eHolder>
      >
      </div>
      >
      <div id="WaitScreen "
      class="absConte ntArea" style='display: none'>
      >
      <table border="0" width="100%">
      >
      <tr align="center">
      >
      <td align="center">
      >
      <asp:Image
      ID="ProgressIma ge" ImageAlign="abs middle" ImageUrl="~/Images/progress.gif"
      AlternateText=" In Progress" runat="server"/>
      >
      <!--img
      id="ProgressIma ge" align=absmiddle src="/Images/progress.gif" alt="In
      Progress" /-->
      >
      </td>
      >
      </tr>
      >
      <tr align="center"
      valign="top">
      >
      <td align="center"
      valign="top">
      >
      <font face="Tahoma"
      style="font-weight:bold" size="3"><%= BusyMessage %></font>
      >
      <% if
      (this.DisplayTi mer) { %>
      >
      <br /><br />
      >
      <span id="time"
      class="waitTime r">
      >
      &nbsp;&nbsp;
      >
      </span>
      >
      <% } %>
      >
      </td>
      >
      </tr>
      >
      </table>
      >
      </div>
      >
      <div id="Content"
      class="absConte ntArea">
      >
      <asp:ContentPla ceHolder ID="ContentArea " runat="server" >
      >
      <h3>Default Content</h3>
      >
      </asp:ContentPlac eHolder>
      >
      </div>
      >
      <div id="AppNavBar" class="appNav">
      >
      <asp:ContentPla ceHolder ID="AppNavBarAr ea" runat="server">
      >
      <div id="appNavSect" >
      >
      <asp:ImageButto n ID="AppNavBarBa ck" runat="server"
      AlternateText=" Back" CssClass="appNa vBtn1" ImageUrl="~/Images/Back.jpg"
      Visible="false" OnClick="AppNav BarBack_Click" />
      >
      <asp:ImageButto n ID="AppNavBarUp " runat="server"
      AlternateText=" Up" CssClass="appNa vBtn2" ImageUrl="~/Images/up.jpg"
      Visible="false" OnClick="AppNav BarUp_Click" />
      >
      <asp:ImageButto n ID="AppNavBarDo wn" runat="server"
      AlternateText=" Down" CssClass="appNa vBtn3" ImageUrl="~/Images/down.jpg"
      Visible="false" OnClick="AppNav BarDown_Click" />
      >
      <asp:ImageButto n ID="AppNavBarNe xt" runat="server"
      AlternateText=" Next" CssClass="appNa vBtn4" ImageUrl="~/Images/next.jpg"
      Visible="false" OnClick="AppNav BarNext_Click" />
      >
      <asp:ImageButto n ID="AppNavBarGo " runat="server"
      AlternateText=" Go" CssClass="appNa vBtn4" ImageUrl="~/Images/go.gif"
      Visible="false" OnClick="AppNav BarGo_Click" />
      >
      </div>
      >
      </asp:ContentPlac eHolder>
      >
      <div class="ScreenID "><asp:Labe l ID="lblScreenID "
      runat="server"> </asp:Label></div>
      >
      </div>
      >
      </form>
      >
      >
      >
      <script language="javas cript" type="text/javascript">
      >
      var theForm = document.forms['aspnetForm'];
      >
      if (!theForm) {
      >
      theForm = document.aspnet Form;
      >
      }
      >
      </script>
      >
      >
      >
      </div>
      >
      <script type="text/javascript" language="javas cript">
      >
      disableSelectio n(document.getE lementById("Mob ileScreen"));
      >
      >
      >
      //set alert icon based on cookie
      >
      if (getCookie('MWN _ALERT_ICON')== '1') {
      >
      alertRecdIcon() ;
      >
      } else {
      >
      alertNormalIcon ();
      >
      }
      >
      </script>
      >
      </body>
      >
      </html>
      >
      >

      Comment

      Working...