On Apr 1, 2012, at 10:25 PM, Junkshops wrote:

> Hi all,
> 
> I'm stumped on an iPhone only problem (works fine on Android, IE, FF,
> Opera, Chrome, Safari) so I'm hoping someone here can point me in the
> right direction.
> 
> When a user loads my page for the first time on an iPhone, the two
> portions of the page generated by an Ajax.Updater call are garbled -
> they look as if a binary file were injected into the page or the
> character map was scrambled. If the user then reloads the page, or
> uses the page's tabs to navigate around via Ajax.Updater requests,
> everything is then fine. It's only the very first time the page is
> loaded in a browser session that this occurs. Here are the relevant
> calls with a bit of context:
> 
> soundManager.onready(function(){
>               new Ajax.Updater('PlayerSet', 'http://' + location.host +
> playerHTMLloc, {method: 'post', onComplete: startPlayer});
> });
> 
> This is only called once per site visit (so the user has to reload in
> order to get it to display correctly). It calls a python script that
> writes html to stdout.
> 
> Here's the other:
> 
> show: function(elm) {
>               var id = elm.identify();
>               elm.addClassName(id.sub('-html', '-selected'));
>               var link = 'ajax/' + id.sub('-', '.');
>               $('centercontent').update('<div 
> id="floaterForSpinner"></div><div
> id="centerSpinner"><img src="images/ajax-loader.gif"></div>');
>               new Ajax.Updater('centercontent', link, {evalScripts: 'true',
> method: 'post'});
> }
> 
> This is part of a small class that handles tabs on the page. Again,
> only the first time show() is called does the error occur. After that
> the tabber works normally. The updater is just pulling html text files
> from the server.
> 
> The issue occurs with both Prototype/Scripty 1.6.1/1.8.3 and
> 1.7/1.9.0.
> 
> What the heck is going on here?
> 
> Thanks for any help.
> 
> P.S. I don't have an iPhone myself, and none of the online iPhone
> simulators reproduce the problem, so testing this is going to be a
> nightmare...

Look very carefully at the headers being sent by your server at the initial 
request and subsequent ones -- make sure everything is Unicode all the way 
through. (You don't need anything more exotic than Firebug to see that.) 
Garbled characters can mean that Unicode is being sent as if it was another 
charset. Maybe your initial load isn't explicitly setting the UTF-8 charset as 
the desired response, but since all subsequent responses are to Ajax loads 
(where the charset is explicitly requested) the text appears to "correct" 
itself.

Walter

> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Prototype & script.aculo.us" group.
> To post to this group, send email to prototype-scriptaculous@googlegroups.com.
> To unsubscribe from this group, send email to 
> prototype-scriptaculous+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/prototype-scriptaculous?hl=en.
> 

-- 
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com.
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.

Reply via email to