Are you enjoying the extensions? Did you like the support? Help others decide.

Leave a review

file JQuery Easy stripping a little too much...

More
11 years 11 months ago #1367 by kbrookes
Hi There,

I've been getting an odd error cropping up whenever jQuery Easy is enabled:

"Uncaught SyntaxError: Unexpected end of input"

I've traced it back to a bit of an odd interaction with the SqueezeBox script included with Joomla.

With jQuery Easy disabled, this script is inserted into the site by Joomla (with an additional var at the end by K2)
<script type="text/javascript">

		window.addEvent('domready', function() {

			SqueezeBox.initialize({});
			SqueezeBox.assign($$('a.modal'), {
				parse: 'rel'
			});
		});
var K2SitePath = '/ode/';
jQuery.noConflict();
  </script>

When I turn on jQuery Easy, this script is truncated to this:
<script type="text/javascript">

		window.addEvent('domready', function() {

			SqueezeBox.initialize({});
			SqueezeBox.assign($$('a.modal'), {
				parse: 'rel'
			});

  </script>

What happens is that in addition to truncating this:
var K2SitePath = '/ode/';
jQuery.noConflict();

It also removes the closing }); statement for the preceding javascript.

Any ideas on how I could solve this one?

I attempted a preg replace, but so far with no success.

Please Log in or Create an account to join the conversation.

More
11 years 11 months ago #1368 by admin
Hello,
I am away and cannot really look at this case closely for a few days but the thing you can do right now is set the option 'strip no conflict code' to 'no' and avoid the stripping.
You will have to determine which extension adds the jQuery.noConflict() code and see if you can turn it off. Depending on your configuration, that code may not even be a problem to leave in place.

Olivier.

Please Log in or Create an account to join the conversation.

More
11 years 11 months ago #1369 by kbrookes
Replied by kbrookes on topic Re: JQuery Easy stripping a little too much...
Good call - I guess it really doesn't matter if there are multiple instances of the no conflict code in there.

That's fixed it, thanks

Please Log in or Create an account to join the conversation.

More
11 years 11 months ago #1372 by admin
You are welcome.
I will use your example to help fix the stripping issue that you discovered.

Olivier.

Please Log in or Create an account to join the conversation.

More
11 years 7 months ago - 11 years 7 months ago #2063 by admin
I have finally figured out why the code was getting stripped. I have found out what was wrong after testing the issue on a user's test site. I could not reproduce the problem on my own test sites.
Version v1.4.3 will address this and hopefully will put an end to these annoying (but rare) errors.
Thank you Cyril for your contribution.

Olivier.
Last edit: 11 years 7 months ago by admin.

Please Log in or Create an account to join the conversation.

More
11 years 7 months ago #2064 by kbrookes
Replied by kbrookes on topic JQuery Easy stripping a little too much...
Ironically, I believe the latest update to K2 2.6.6 removes the offending line anyway!

But thank you!

Please Log in or Create an account to join the conversation.