1

I have an application in which i need to parse and display data from webservice. Here i have 2 different services, in one service i have 24 items and in another service i have 200 items. For service with 24 items i am able to display it properly but the service with 200 items showing javascript execution exceeded timeout error and displaying blank page.The code is same for both services. Can anyone please help me how to get rid of this error and display data properly?

I am adding piece of code here

 <script type="text/javascript">
        function showMessage(data, index) {
            var obj = jQuery.parseJSON(data.d);
            if (index == "TrackDeals") {
                trackDeals(obj);
            } 
        }

        function OnError(request, status, error) {
            alert(request.statusText);
        }

        function trackDeals(trackdeals) {
            var items = [];
            var count = 0;
            $.each(trackdeals, function(key, value) {
                count++;
                pid = value.ApplicationId;
                var str = localStorage.getItem("appidlist");
                if (str == null){
                    var html = '<tr> my html code </tr>';
                } else {
                    var mySplitResult = str.split(",");
                    for(var i = 0; i < mySplitResult.length; i++) {
                        if(mySplitResult[i] == pid) {
                            var html = '<tr> my html code </tr>';
                        } else {
                            var html = '<tr> my html code </tr>';
                       }
                    }
                }
                items.push(html);
            });
            $('#trackdeals').html(items.join('')).trigger('create');
            $("table tr").slice(0, 5).show();
            $("#load").click(function(e) {
                e.preventDefault();
                $("table tr:hidden").slice(0, 5).show();
                if ($("table tr:hidden").length == 0) {
                    alert("No more data");
                }
            });
        }

        $(document).ready(function() {
            document.getElementById('username').innerHTML = "name";
            var trackparam = username + ',' + userid;
            CallWebServiceFromJquery('TrackDeals', trackparam);
        });
    </script>

</head>
<body>
    <div class="deals-content">
                    <div class="deals-table-header">
                        <table width="100%" class="table">
                            <tr>
                                <td width="18%">Reference Id</td>
                                <td width="22%">Account</td>
                                <td width="24%">Agency Name</td>
                                <td width="27%">Product</td>
                                <td width="8%"></td>
                            </tr>
                        </table>
                    </div>
                    <div class="deals-table-content">
                        <table width="100%" class="deals-table-header-table" id ="trackdeals"></table>
                        <button id="load" style="width: 98%; font-weight: bold">Load More</button>
                    </div>
                </div>

</body>

Edit: I am able to get output for same code in gingerbread emulator but i am facing this error with honeycomb emulator.

android phonegap
  • 830
  • 3
  • 17
  • 35

0 Answers0