Re: Re: Delaying $(document).ready() in jQuery until php script finish

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Mar 11, 2011 at 10:31 PM, David Hutto <smokefloat@xxxxxxxxx> wrote:
> On Sat, Mar 12, 2011 at 1:21 AM, Tommy Pham <tommyhp2@xxxxxxxxx> wrote:
>> I think the OP is having both PHP & JS codes mixed and scattered all
>> over the page. ÂIf chunked-encoding used without any ob*
>> implementation, then that's the problem he'll experience.
>>
>> Richard,
>>
>> I recommend to put the $(document).ready() and any JS scriptlets
>> within <body></body> tags at the very bottom of the HTML document just
>> right before </body>. ÂThis would allow the mixed PHP/HTML to finish
>> without creating problems for your JS code(s).
>
> Why not separate them all, i.e. js, php, html, and if it was in there,
> css. If you can use them all, then separating them out should be
> *easy*(I still would have to use references for that many languages).
> Think of it as an expository writing, with the includes being the main
> topics, the content being composed of these higher ideas, and the
> conclusion, just closing it out.
>
> Pick the focus, I'd say php, and echo the rest out. Or html, and
> include the php, css and js.
>

This would depend on the original application design & code.  The
solution you're proposing is ideal which, for the most part, would
probably require the app redesign/rewrite.  However, if Richard isn't
one of the originator(s) of the app's developers or he's only
experiencing the problem on a very few limited pages, moving the JS
codes to the bottom would be a faster fix.  In the end, it all depends
on his environment and immediate need.

>
>
> ÂThe other solution is
>> implement output buffer using ob* functions.
>>
>> Regards,
>> Tommy
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>
>
>
> --
> According to theoretical physics, the division of spatial intervals as
> the universe evolves gives rise to the fact that in another timeline,
> your interdimensional counterpart received helpful advice from me...so
> be eternally pleased for them.
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux