Php photo gallery TWG | JFUploader | TWG Flash upload | WFU | Forum
https://www.tinywebgallery.com/forum/

keepalive JS code above the DOCTYPE !?
https://www.tinywebgallery.com/forum/viewtopic.php?f=13&t=3187
Page 1 of 1

Author:  foleox [ 19. Dec 2011, 21:21 ]
Post subject:  keepalive JS code above the DOCTYPE !?

Using Joomla 1.5.23 / JFUploader 2.14.x / Linux server PHP 5.x

I had a problem with the "keepalive" javascript which is included in the JFU code : the plugin seems deliberately to echo some JS script code ABOVE the DOCTYPE ..!? My browsers FireFox, Google Chrome and Opera have no problem with that, but IE has some weird problems with this code construction. In IE9 : some none-JFU page elements suffer some focus and css errors (hard to say exactly what happened, but i guess this is not important here). NOTE: i tested with and without the "meta http-equiv='X-UA-Compatible' content='IE=EmulateIE7'" head tag.

In these JFU files i find the concerning JS codes :

A) /components/com_jfuploader/jfuploader.html.php
(NOTE: also /administrator/components/com_jfuploader/admin.jfuploader.html.php contains the concerning JS code, but i did not edit this file)
*** here some keepalive function is defined and executed

Code:
// we can only have a keepalive if Joomla and JFU use the same session!
if ($jConfig->session_handler != 'database') {
  echo JHTML::_('behavior.keepalive');
}
// now I overwrite the existing function.
echo (.....the JS code.....)


B) /components/com_jfuploader/jfuploader.class.php
*** here the concerning JS code resides in the function printCss(), which dynamically adds some css code to the page head.

By commenting-out these JS includes, i simply managed to solve my problem !

So, to echo JS script code ABOVE the DOCTYPE, is that proper coding ?
And what does the keepalive function do anyway? Leaving its code out, JFU also seems to function properly in all my browsers ..!?

R

Author:  TinyWebGallery [ 20. Dec 2011, 09:58 ]
Post subject:  Re: keepalive JS code above the DOCTYPE !?

Hi,

Can you give me more details?
Which Joomla Version?
Which JFU version?
Component or plugin?
Which page?

I just checked a couple of pages where I have JFU and nothing comes above the doctype.
And of course there should nothing before the doctype.

The keepalive is that you don't get logged out if your upload is longer than the session timeout.

- Michael

Author:  TinyWebGallery [ 20. Dec 2011, 10:09 ]
Post subject:  Re: keepalive JS code above the DOCTYPE !?

btw. the keepalive function is a Joomla function I only use.

- Michael

Page 1 of 1 All times are UTC + 1 hour [ DST ]
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/