xuijs / xui

A tiny javascript framework for mobile web apps.
http://xuijs.com
788 stars 106 forks source link

Blackberry 5.0 issues with HTML and before #21

Closed jbuergel closed 13 years ago

jbuergel commented 13 years ago

Posted from the Phonegap mailing list: the following code gives a "The page you requested could not be loaded; it is too large for the device" error when the button is clicked, both inside a Phonegap app as well as off a standard web page:

x$(window).load(function(e){ 
    x$('#button-add').click(function(){ 
      x$('#header').html('before','<div id="new-div">Hello!</div>'); 
    }); 
}); 

<div id="header"> 
   <h1>A header</h1> 
   <button id="button-add">Click me</button> 
</div><!-- /header --> 
filmaj commented 13 years ago

A couple of questions:

Let me know and I will continue looking into this one.

filmaj commented 13 years ago

Also, are you using PhoneGap with WebWorks or PhoneGap for BlackBerry 4.6?

jbuergel commented 13 years ago

I am using PhoneGap with Webworks, but it reproduces independently of PhoneGap - I put my page up on an external site and it had the same behavior. I'm using the 9550 emulator, running 5.0.0.469. As we're currently in the process of evaluating Blackberry options, I haven't tried it out on real hardware yet. I noticed that the code above got pretty mangled, I posted it over here as well: http://groups.google.com/group/phonegap/browse_thread/thread/99786c00cee1b760

filmaj commented 13 years ago

Hey,

How did you get your hands on the 9550 simulator running 5.0.0.469? If I go to the simulator downloads I see a bunch of different ones but not .469.

In the mean time I will test with the 5.0.0.517 simulator and report back.

jbuergel commented 13 years ago

It's in the simulator pack for the Webworks install that I have, in [webworks]/simpack/5.0.0.469

filmaj commented 13 years ago

O sweet it is there. Thanks! I'll check with both :)

filmaj commented 13 years ago

Yeah the XUI test suite doesn't even finish on .469 (but does on .517). BlackBerries are so fucking bad, I don't understand how anyone uses it as a phone

jbuergel commented 13 years ago

Any idea if that OS is common in the wild?

filmaj commented 13 years ago

It's a crapshoot, no idea. RIM only provides the major revision number market shares (i.e. 4.2, 4.6, 5.0, etc.). Additionally, it is completely up to the user as to what OS revision they can run. They can easily upgrade their OS using their Desktop Manager software.

I'll take another stab at this today and see what the cause for the failing tests are, and if I can reproduce your particular error. It's funny because five or six of the xui tests fail on the revision you mention, but the test for .html('before') passes...

filmaj commented 13 years ago

I reworked the way .html works in b6f69beb5a1f43cf73c32c248a12a9a82acd4e53 - I'll try to rerun the tests when I get back into the office. Would be worth a shot to try again.

jbuergel commented 13 years ago

I'll give it a whirl, thanks. I've largely worked around this problem by having skeleton divs and filling them in as necessary, but it's kind of a pain.

On Tue, May 3, 2011 at 5:39 PM, filmaj reply@reply.github.com wrote:

I reworked the way .html works in b6f69beb5a1f43cf73c32c248a12a9a82acd4e53 - I'll try to rerun the tests when I get back into the office. Would be worth a shot to try again.

Reply to this email directly or view it on GitHub: https://github.com/xui/xui/issues/21#comment_1097363

gabrielfin commented 13 years ago

I was having the same issue and found out that the problem were a couple of regexp in the wrap() function that the browser didn't like. To solve it, replace the following:

Line 553:

- attr = attrList[i].replace(/^\s*|\s*$/g, "");
+ attr = attrList[i].replace(/^\s+|\s+$/g, "");

Line 556:

- attributes[node[0]] = node[1].replace(/(["']?)/g, '');
+ attributes[node[0]] = node[1].replace(/["']/g, '');
filmaj commented 13 years ago

@gabrielfin - I have pretty much removed everything in wrap and replaced it with a simpler approach that passes all the specs. See the latest commits!

filmaj commented 13 years ago

With the new way xui does wrapping, I think this one's resolved. Closed!