Re: Safari Issue
On Aug 13, 3:01 am, GinnTech <Tim.Dale.G...@ gmail.comwrote:
What part of Prototype.js is "the fix"?
There is no *guarantee* that all content has been loaded when the load
event fires in any browser. Not loading a dependent resource will not
stop the load event from occurring provided the resource that loads it
is available.
That strategy is called polling, it is not considered a good strategy
but if it's the only solution then use it. You might want to poll a
bit more frequently than every 3 seconds - say 200ms or so, depending
on what else is happening in the page. You should also cancel polling
after a reasonable number of attempts, the Flash object may not ever
load.
It isn't necessarily about a particular browser, but allowing for a
behaviour that is known to occur.
--
Rob
On Aug 13, 3:01 am, GinnTech <Tim.Dale.G...@ gmail.comwrote:
Here is the fix and the issue.
>
While I was trying to debug this issue I was using the apple provided
"Execute a Script". Essentially just trying to throw things at this
to get results I was wanting. The Prototype framework was the fix.
>
While I was trying to debug this issue I was using the apple provided
"Execute a Script". Essentially just trying to throw things at this
to get results I was wanting. The Prototype framework was the fix.
This 'function' issue was rearing it's head because of how safari
renders the page (for supposedly performance). In safari the actual
page load event is not truly done once the page is fully loaded.
renders the page (for supposedly performance). In safari the actual
page load event is not truly done once the page is fully loaded.
event fires in any browser. Not loading a dependent resource will not
stop the load event from occurring provided the resource that loads it
is available.
I
will say at least in this case concerning Flash. The .jsp page in
this case yes may be loaded, but the swf had not been completely
loaded when the script was being executed. So when the script tried
to access the swf's exposed functions they were not available
immediately. resulting in the return of a 'function' and not an
'object'. I discovered this by executing
>
$('TaskShell'). initShell(API_1 484_11.GetValue ("cmi.launch_da ta")
+"&"+"<%=dat a %>");
>
after the page had been loaded a couple seconds and to all amazement
the content loaded in the swf. The fix if you want to call it that is
to check the flash object to see if it is being returned with a type
of 'function'. If so I am pausing the execution of the script by 3
seconds to allow for the swf to completely download and be available
to the browser. Now all is good.
will say at least in this case concerning Flash. The .jsp page in
this case yes may be loaded, but the swf had not been completely
loaded when the script was being executed. So when the script tried
to access the swf's exposed functions they were not available
immediately. resulting in the return of a 'function' and not an
'object'. I discovered this by executing
>
$('TaskShell'). initShell(API_1 484_11.GetValue ("cmi.launch_da ta")
+"&"+"<%=dat a %>");
>
after the page had been loaded a couple seconds and to all amazement
the content loaded in the swf. The fix if you want to call it that is
to check the flash object to see if it is being returned with a type
of 'function'. If so I am pausing the execution of the script by 3
seconds to allow for the swf to completely download and be available
to the browser. Now all is good.
but if it's the only solution then use it. You might want to poll a
bit more frequently than every 3 seconds - say 200ms or so, depending
on what else is happening in the page. You should also cancel polling
after a reasonable number of attempts, the Flash object may not ever
load.
Well I hope we all learned something and maybe this can help someone
in the future. I know I now know more than I ever wanted to know about
a browser less than 2% of the world uses.
in the future. I know I now know more than I ever wanted to know about
a browser less than 2% of the world uses.
behaviour that is known to occur.
--
Rob
Comment