Reputation: 17247
I've created a JQuery Mobile Site which picks the data from CSE webservice. I released teh source also at github.
My problem is site works fine when loaded via browser but when I try to load it via Mobile Browser it keeps on loading....!
can someon eplease enlight me? Does it something to do with the XML file size that receive from webservice??
Thanks for your time in advance.
Upvotes: 1
Views: 118
Reputation: 13115
Depending on your connection (3G, LTE, Wifi) it could certainly be the latency in loading the XML file, but it is only ~130kb which isn't that huge. It took my browser 2.75 seconds to load.
Have you already profiled this web app with something like Google Chrome? If you run a profile and load the page, you'll find that over 60% of your load time is lost in a jquery filter selector. This means that you could really benefit from tuning your endCallService
function.
Because of the size of the xml document, if you could reduce the amount of time you traverse it than your code will work a lot better. The xmlHttpRequest object can be traversed as an array so I think you could speed things with something like this:
listStr = listStr + .... xmlHttpRequest[0][j][i]
The first [0]
is the first table element. The next position, [j]
is the row. Then the [i]
is your column still.
Could you try that and see if that performs better? I was unable to test in jsfiddle because I was getting server errors trying to access your proxy.php script.
This should work and when it does, you will be able to squeeze the same performance out of the other objects you are loading in the next nested loop. (var shareName, shareVolume, etc).
Cheers!
Upvotes: 1