Page 1 of 2

[IE7 fatal error] Jtooltips - window.addEvent('domready', f

Posted: Fri Jul 25, 2008 4:04 pm
by etiennehpj
I'm using Fusion chart to build chart (flash) on my front page. There are some javascript conflicts which cause IE7 to crash in a very ugly way (Operation aborted ... IE7 close windows). no pb with firefox.

I managed to solve this in the past by disabling some useless javascript import.

I had again the issue using Acajoom module. I compared the HTML source code with and without Acajoom, the only difference is a the top of the page, in the Joomla include part, a new Javascript function is called :

<script type="text/javascript" src="/includes/js/joomla.javascript.js"></script>
<script type="text/javascript" src="/media/system/js/mootools.js"></script>
<script type="text/javascript" src="/media/system/js/caption.js"></script>
<script type="text/javascript">
window.addEvent('domready', function(){ var JTooltips = new Tips($$('.hasTip'), { maxTitleChars: 50, fixed: false}); });
</script>

<meta http-equiv="Content-Type" content="text/html;>charset=utf-8" />
<meta http-equiv="cache-control" content="no-cache" />

I don't know why this script appears when I enable Acajoom module and I don't know where this script is called, but I strongly think that it's responsible for my IE7 behaviour ... any idea ?

[Solved]-IE7 fatal error- Jtooltips - window.addEvent('domre

Posted: Fri Jul 25, 2008 4:54 pm
by etiennehpj
I found this in a forum, wonderfull everything's working fine now :

'his is a possible fix for this issue. I was running ie7 / joomla 1.5 / & using tooltips / & sobi2 2.8.6. This fixed it.
The test would be to change the following file and turning the editor back on.
/libraries/joomla/html/html/behavior.php
~line 108
$tooltipInit = ' window.addEvent(\'domready\', function(){ var JTooltips = new Tips($$(\''.$selector.'\'), '.$options.'); });';
to
$tooltipInit = ' window.addEvent(\'load\', function(){ var JTooltips = new Tips($$(\''.$selector.'\'), '.$options.'); });';

Reason: IE has problems with domready. Load - is used so that all pictures are loaded first then runs the javascript routine.'
'
Another IE bug ...

Re: [IE7 fatal error] Jtooltips - window.addEvent('domready', f

Posted: Fri Jul 25, 2008 8:53 pm
by iid
OMG, thank you so much...I have been searching for a solution to this error for hours and this worked for me!

:D

Re: [IE7 fatal error] Jtooltips - window.addEvent('domready', f

Posted: Tue Aug 12, 2008 2:23 pm
by capsite
absolutely works!!!!!!!!!
I'm tinkled pink. lol :) :laugh: ;D :D

Re: [IE7 fatal error] Jtooltips - window.addEvent('domready', f

Posted: Mon Oct 20, 2008 9:36 pm
by MiguelJeri
Thanks! Solved my problem :D

Re: [Solved]-IE7 fatal error- Jtooltips - window.addEvent('domre

Posted: Thu Dec 04, 2008 5:12 pm
by natasha
etiennehpj wrote:I found this in a forum, wonderfull everything's working fine now :
Should I give you another suggest, you can also operate this way.
Download latest MooTools release, say 1.2.1 (better the YUI-compressed release), rename it, say "mootools-frontend.js", and put it in /media/system/js.
Open /libraries/joomla/html/html/behavior.php and when it comes adding mootools library to headers (better and study a way adding it "downer" in page, but this is another topic), modify so the simple "else" branch which detects if you're using Konqueror or you're in detect mode:

if ( JString::stristr($_SERVER['REQUEST_URI'], "administrator") ) {
JHTML::script('mootools.js', 'media/system/js/', false);
} else {
JHTML::script('mootools-frontend.js', 'media/system/js/', false);
}

instead of a simple

JHTML::script('mootools.js', 'media/system/js/', false);

You're now using an IE7-compatible version of MooTools client-side (that is, VISITORS side), you're using Joomla!-"native" version of MooTools admin side.
Most important, you can continue and use "domready" even if you use IE7.
If there are problems, they're admin side... but, oh, admin/developer/designer head is expendable in front of visitors' necessities, isn't it? :)

Re: [IE7 fatal error] Jtooltips - window.addEvent('domready', f

Posted: Tue Jan 20, 2009 6:44 am
by cvoogt
Thanks etiennehpj. That works.
I am running J 1.5.9, and wonder why this issue still exists. Looks to me like it should be submitted as a bug. I ran into this when using a modal window using:

Code: Select all

JHTML::_( 'behavior.modal' );

Natasha, I would have liked to follow your suggestion but couldn't quite understand what you meant ... not sure where to add the code you suggested.

Re: [IE7 fatal error] Jtooltips - window.addEvent('domready', f

Posted: Tue Jan 20, 2009 7:00 pm
by natasha
cvoogt wrote:Natasha, I would have liked to follow your suggestion but couldn't quite understand what you meant ... not sure where to add the code you suggested.
Search for

JHTML::script('mootools.js', 'media/system/js/', false);

and substitute with

if ( JString::stristr($_SERVER['REQUEST_URI'], "administrator") ) {
JHTML::script('mootools.js', 'media/system/js/', false);
} else {
JHTML::script('mootools-frontend.js', 'media/system/js/', false);
}

***AFTER*** you've downloaded http://mootools.net/download/get/mootoo ... core-yc.js, renamed it as mootools-frontend.js and copied it in /media/system/js.

Re: [IE7 fatal error] Jtooltips - window.addEvent('domready', f

Posted: Tue Jan 20, 2009 7:21 pm
by cvoogt
That's awesome - thanks for your help!!

Re: [IE7 fatal error] Jtooltips - window.addEvent('domready', f

Posted: Fri Jan 30, 2009 7:09 am
by sunnyjey
Thank you Natasha for such a wonderful hack. I think this should be implemented within core files of next Joomla version.

Just one more question: I have changed files as suggested by you. Now problem is that there are few components and modules who still use 1.1 and are non-compatible with 1.2. At present i am using Gavick tabs which is incompatible with Mootools 1.2

After this hack my Gavick tabs are not working because of this incompatible issue. How do i force Gavick to use mootools 1.1 ? (as becuase of your excellent hack we have both 1.1. and 1.2)

I will be really grateful to you for suggestion.

Thank you once again.

Sunny

Re: [IE7 fatal error] Jtooltips - window.addEvent('domready', f

Posted: Fri Jan 30, 2009 9:14 am
by natasha
sunnyjey wrote:How do i force Gavick to use mootools 1.1 ? (as becuase of your excellent hack we have both 1.1. and 1.2)
Well, whilst this is tricky and DEFINITELY difficult to maintain, you can think about

$toDetect = array("administrator", "com_gavick");
$bOldVersion = false;
for ($iCount = 0; $iCount < ($toDetect.count() - 1); $iCount++) {
if ( JString::stristr($_SERVER['REQUEST_URI'], $toDetect[$iCount]) ) {
$bOldVersion = true;
break;
}
}
if ( $bOldVersion ) {
JHTML::script('mootools.js', 'media/system/js/', false);
} else {
JHTML::script('mootools-frontend.js', 'media/system/js/', false);
}

In $toDetect array you put "administrator", "com_gavick" (or how Gavick component is called in "option" parameter on your querystring), and all "things" not compatible with Mootools 1.2.

Re: [IE7 fatal error] Jtooltips - window.addEvent('domready', f

Posted: Fri Jan 30, 2009 9:40 am
by sunnyjey
Thanks you Natasha,

I added the code as suggested by you.. but i got the following code message in the frontend:


Code: Select all

      * JHTMLBehavior::caption not found in file.
        * JHTMLBehavior::mootools not found in file.

Re: [IE7 fatal error] Jtooltips - window.addEvent('domready', f

Posted: Fri Jan 30, 2009 3:06 pm
by natasha
sunnyjey wrote:Thanks you Natasha,

I added the code as suggested by you.. but i got the following code message in the frontend:


Code: Select all

      * JHTMLBehavior::caption not found in file.
        * JHTMLBehavior::mootools not found in file.
WHERE did you add it? :)

Re: [IE7 fatal error] Jtooltips - window.addEvent('domready', f

Posted: Fri Jan 30, 2009 4:41 pm
by sunnyjey
I added code in /libraries/joomla/html/html/behaviour.php

Also changed com_gk2_tabs_manager

So my behaviour.php looks like this-

Code: Select all

	// TODO NOTE: Here we are checking for Konqueror - If they fix thier issue with compressed, we will need to update this
		$konkcheck = strpos (strtolower($_SERVER['HTTP_USER_AGENT']), "konqueror");

		if ($debug || $konkcheck) {
			JHTML::script('mootools-uncompressed.js', 'media/system/js/', false);
		} else {
			if ( JString::stristr($_SERVER['REQUEST_URI'], "administrator") ) {
JHTML::script('mootools.js', 'media/system/js/', false);
} else {
JHTML::script('mootools-frontend.js', 'media/system/js/', false);
}
$toDetect = array("administrator", "com_gk2_tabs_manager");
$bOldVersion = false;
for ($iCount = 0; $iCount < ($toDetect.count() - 1); $iCount++) {
if ( JString::stristr($_SERVER['REQUEST_URI'], $toDetect[$iCount]) ) {
$bOldVersion = true;
break;
}
}
if ( $bOldVersion ) {
JHTML::script('mootools.js', 'media/system/js/', false);
} else {
JHTML::script('mootools-frontend.js', 'media/system/js/', false);
}
		}
		$loaded = true;
		return;
	}

Re: [IE7 fatal error] Jtooltips - window.addEvent('domready', f

Posted: Fri Jan 30, 2009 8:53 pm
by natasha
sunnyjey wrote: So my behaviour.php looks like this-
Definitely as I suspected :)
My code was a SUBSTITUTION for previous way and selectively load mootools version, NOT an add :)

In practice, you've and delete following rows:
if ( JString::stristr($_SERVER['REQUEST_URI'], "administrator") ) {
JHTML::script('mootools.js', 'media/system/js/', false);
} else {
JHTML::script('mootools-frontend.js', 'media/system/js/', false);
}
Finally, your code has to be:
// TODO NOTE: Here we are checking for Konqueror - If they fix thier issue with compressed, we will need to update this
$konkcheck = strpos (strtolower($_SERVER['HTTP_USER_AGENT']), "konqueror");

if ($debug || $konkcheck) {
JHTML::script('mootools-uncompressed.js', 'media/system/js/', false);
} else {
$toDetect = array("administrator", "com_gk2_tabs_manager");
$bOldVersion = false;
for ($iCount = 0; $iCount < ($toDetect.count() - 1); $iCount++) {
if ( JString::stristr($_SERVER['REQUEST_URI'], $toDetect[$iCount]) ) {
$bOldVersion = true;
break;
}
}
if ( $bOldVersion ) {
JHTML::script('mootools.js', 'media/system/js/', false);
} else {
JHTML::script('mootools-frontend.js', 'media/system/js/', false);
}
}
$loaded = true;
return;
}
Try, and let us know :)

P.S.: post no more a thing like "/public_html/". Disclosing your own file system structure is NOT a good practice :)

Re: [IE7 fatal error] Jtooltips - window.addEvent('domready', f

Posted: Sat Jan 31, 2009 5:45 am
by sunnyjey
Thank you once again:

I got following error on frontend after doing changes in behaviour.php as suggested by you:

Code: Select all

Warning: count() expects at least 1 parameter, 0 given in ../libraries/joomla/html/html/behavior.php on line 58
PS:Thanks for informing me one of the most imp thing about directory. I have edited my previous post and removed the starting tag. ;)

Natasha! Is it possible for me to redirect behaviour.php to use Mootools 1.2 for one particular component? I have been facing this conflict domready problem with sobi2 frontend directory pages. I have replaced 'domready' with 'load' as per suggestion in 2 or 3rd post. But it seems there are few more domready in other components/plugins which I am not able locate - sobi2 directory pages to crash IE7.

But when I apply your solution to use Mootools 1.2 for frontend and Mootools 1.1 for backend, the sobi2 component pages works like charm. But the problem with this is that other components like Gavick tabs stop working as they are incompatible with mootools 1.2

So can we edit this code in such a way to use Mootools 1.2 for Sobi2 and 1.1 for rest of the components including backend and Gavick pro ?

Re: [IE7 fatal error] Jtooltips - window.addEvent('domready', f

Posted: Sat Jan 31, 2009 8:52 am
by natasha
sunnyjey wrote:Thank you once again:

I got following error on frontend after doing changes in behaviour.php as suggested by you:
Trivial error of mines: instead of $toDetect.count() - 1, is count($toDetect) - 1
Sorry.
Is it possible for me to redirect behaviour.php to use Mootools 1.2 for one particular component?
In $toDetect, put just the "option" parameter tied to Sobi2. It will be something as com_sobi2.

Re: [Solved]-IE7 fatal error- Jtooltips - window.addEvent('domre

Posted: Mon Feb 02, 2009 3:53 am
by MalinaDZ
natasha wrote:
etiennehpj wrote:I found this in a forum, wonderfull everything's working fine now :
Should I give you another suggest, you can also operate this way.
Download latest MooTools release, say 1.2.1 (better the YUI-compressed release), rename it, say "mootools-frontend.js", and put it in /media/system/js.
Open /libraries/joomla/html/html/behavior.php and when it comes adding mootools library to headers (better and study a way adding it "downer" in page, but this is another topic), modify so the simple "else" branch which detects if you're using Konqueror or you're in detect mode:

if ( JString::stristr($_SERVER['REQUEST_URI'], "administrator") ) {
JHTML::script('mootools.js', 'media/system/js/', false);
} else {
JHTML::script('mootools-frontend.js', 'media/system/js/', false);
}

instead of a simple

JHTML::script('mootools.js', 'media/system/js/', false);

You're now using an IE7-compatible version of MooTools client-side (that is, VISITORS side), you're using Joomla!-"native" version of MooTools admin side.
Most important, you can continue and use "domready" even if you use IE7.
If there are problems, they're admin side... but, oh, admin/developer/designer head is expendable in front of visitors' necessities, isn't it? :)
Natasha, these steps did help to fix the error message in IE7, but pictures are not displayed in Polaroid mode on a remote server, just empty frames. Everything works fine on my localhost though. One more thing, main menu lost the visual effects it had before editing the behavior.php
How can I restore those effects with the changes made to the behavior.php? Thank you.

Re: [IE7 fatal error] Jtooltips - window.addEvent('domready', f

Posted: Sun Feb 08, 2009 1:05 am
by Leneg2008
Thanks etiennehpj, you saved my day.

Hope that everyone who ask and find solutions by themselfs could share it.

I hate people when they just say.. Forget it I found it :-\

Regards

Re: [Solved]-IE7 fatal error- Jtooltips - window.addEvent('domre

Posted: Sun Feb 08, 2009 10:20 am
by natasha
MalinaDZ wrote: Natasha, these steps did help to fix the error message in IE7, but pictures are not displayed in Polaroid mode on a remote server, just empty frames. Everything works fine on my localhost though. One more thing, main menu lost the visual effects it had before editing the behavior.php
How can I restore those effects with the changes made to the behavior.php? Thank you.
As I said, this is a tricky solution and difficult to maintain :)
Anything you want and use MooTools default version, detect an identifying string in querystring and put it in $toDetect array.
This is true also for your "pictures in Polaroid mode" (not sure what you refer to).

Re: [IE7 fatal error] Jtooltips - window.addEvent('domready', f

Posted: Thu Feb 19, 2009 4:12 am
by lpeterson23
etiennehpj,

Totally worked for me. Thank you SOO much!

Re: [IE7 fatal error] Jtooltips - window.addEvent('domready', f

Posted: Sat Feb 28, 2009 4:22 pm
by Varsys
Thanks etiennehpj! I was looking for a solutiion for quite some time.

Re: [IE7 fatal error] Jtooltips - window.addEvent('domready', f

Posted: Fri Apr 24, 2009 4:11 am
by MrRoyce
Hi there, this was a lot of good 'tips'. I'm trying to place tooltips on an AJAX generated page. The tips appear, but they are not styled (ie, they display as tootiptitle:tooltip text). Its almost as if the JHTML::_('behavior.tooltip'); is being partially invoked, but not quite???

I can get the tips working fine on a non-AJAX page, but I'm not sure how to go about debugging the tips for an AJAX page. Any ideas anyone?

Re: [IE7 fatal error] Jtooltips - window.addEvent('domready', f

Posted: Fri Jul 10, 2009 4:23 pm
by hzwice
I used the fix for the behavior.php file for this ie6/7 problem and it worked well. However, I noticed afterwards that a video I had playing in a pop up window using AllVideos Reloaded no longer worked after making that change. For the time being I have disabled my morfeoshow slideshows and have uploaded the original behavior.php however if anyone has any idea what could be done to rectify the conflict I would really like to go back to using these slideshow.

Re: [IE7 fatal error] Jtooltips - window.addEvent('domready', f

Posted: Tue Sep 29, 2009 12:36 pm
by shameem
I changed
JHTML::script('mootools.js', 'media/system/js/', false);
as
if ( JString::stristr($_SERVER['REQUEST_URI'], "administrator") ) {
JHTML::script('mootools.js', 'media/system/js/', false);
} else {
JHTML::script('mootools-frontend.js', 'media/system/js/', false);

Now getting error that Tips is not defined in line

$tooltipInit = 'window.addEvent(\'load\', function(){ var JTooltips = new Tips($$(\''.$selector.'\'), '.$options.'); });';

Re: [IE7 fatal error] Jtooltips - window.addEvent('domready', f

Posted: Mon Feb 22, 2010 11:33 pm
by DaneBrown
I am having the same issues, here are my conditions slightly different but I believe its the same issues going on: Running Joomla 1.5.15 and VirtueMart 1.1.4, I also run ccNewsletter (looking at my source code I notice it also has a javascript entry, so I am including it here) Testing in IE 8 I crashed (see image) only when I go to my shop http://apexd.com/index.php?option=com_v ... Itemid=146 , with the rest of the site http://apexd.com/all is well, with firefox all is well, I tried a few sugesstion from the forum nothing works, I want to give this a try but because it is intensive I want to ask doe this apply to my condition before I start hacking things. Thanks I am in Miami, dont mind treating you to a drink, lunch, dinner or something just need this fix :pop

Re: [IE7 fatal error] Jtooltips - window.addEvent('domready', f

Posted: Mon Feb 22, 2010 11:52 pm
by MrRoyce
Hi there, Dane I saw a bunch of validation errors on your site that may be causing IE to fail. http://validator.w3.org/check?verbose=1 ... emid%3D146

Also, try starting a new thread, you may get more response there.

Re: [IE7 fatal error] Jtooltips - window.addEvent('domready', f

Posted: Mon Feb 22, 2010 11:59 pm
by jlighthouse
Sorry if I'm mispoint the theme... Is it possible to show the tooltips for items of the list (not dropdown, and that is with attribute multiple="multiple" and some size)?

I have added this code to the view:

Code: Select all

	function displayListItems($tpl = null)
	{
		// get items
		$model =& $this->getModel('Item');
		$items = $model->getItems();

		// create items list
		$itemsList = array();
		JHTML::_('behavior.tooltip');
		foreach($items as &$item) {
			$tooltip = array('tip' => $item->description, 'title' => JText::_('ITEM_DESC'), 'image' => null, 'text' => $item->name, 'href' => null);
			$itemsList[] = JHTML::_('select.option', $item->id, JHTML::_('tooltip', $tooltip['tip'], $tooltip['title'], $tooltip['image'], $tooltip['text'], $tooltip['href']));
		}

		// assign items list
		$this->assignRef('itemsList', $itemsList);
		unset($itemsList);

		parent::display($tpl);
	}
When the layout code of the list is pretty simple:

Code: Select all

...
<?php echo JHTML::_('select.genericlist', $this->itemsList, 'list', array('size' => 10, 'multiple' => 'multiple')) ?>
...
But tooltips does not appear.

Thanks in advance, good luck!

Re: [IE7 fatal error] Jtooltips - window.addEvent('domready', f

Posted: Tue Feb 23, 2010 12:18 am
by DaneBrown
Thanks for the help, I am not that code savvy to fix this, just a waste of of my time, feel like just deleting the whole thing maybe I will leave it for another month or so been going at this for 3 weeks, U never know I may feel better tomorrow

Re: [IE7 fatal error] Jtooltips - window.addEvent('domready

Posted: Sun Jul 25, 2010 8:03 pm
by munnibhai
well hacking into behavior and replacing the code definitely solved the html parsing error (possibly caused by js or something) and page is loading correctly but now it gives error like this object is not supported in index.php on line 98 and in rokbox.js on line 1 char 0.

shall i copy paste the code?

thanks

Edit: i am using IE8.0 (not the beta version)