Go Back   CodingForums.com > :: Client side development > JavaScript programming > JavaScript frameworks

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-18-2012, 11:33 AM   PM User | #1
iainmcewan21885
New to the CF scene

 
Join Date: Jun 2012
Posts: 5
Thanks: 3
Thanked 0 Times in 0 Posts
iainmcewan21885 is an unknown quantity at this point
lightbox problem with internet explorer...

Can anyone help with this...

My website uses a few lightbox slideshows...

http://www.macgregorandmacduff.co.uk/kings-club
http://www.macgregorandmacduff.co.uk/kilts-social
http://www.macgregorandmacduff.co.uk/kilt-hire

they all work fine on firefox and chrome but on internet explorer it just takes you through to the image file.

the f12 tools in IE give the following error report..

object is NULL or undefined lightbox.js, line 226 symbol 20

apparantly this is quite a common problem. I have looked around a few forums and been unable to find a fix. Can anyone help?

Thanks

Iain
iainmcewan21885 is offline   Reply With Quote
Old 07-18-2012, 01:04 PM   PM User | #2
AndrewGSW
Senior Coder

 
Join Date: Apr 2011
Location: London, England
Posts: 2,120
Thanks: 15
Thanked 354 Times in 353 Posts
AndrewGSW will become famous soon enough
The on() method was introduced in jQuery 1.7 but you're using an earlier version of jQuery.

Sensible would be to make sure you're using the most recent version of each library and plug-in, or at least to confirm that the various versions you use are compatible.

However, you are also using jQuery, prototype, and scriptaculous frameworks on the same page. They are competing frameworks (jQuery <=> prototype) and they fight over the use of the dollar sign. jQuery.noConflict() doesn't resolve every issue and you need to use jQuery(..) rather than $(..) sometimes to keep them separate.

Of course, the best long term solution would be to use one framework or the other..
__________________
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
Validate your HTML and CSS
AndrewGSW is offline   Reply With Quote
Users who have thanked AndrewGSW for this post:
iainmcewan21885 (07-18-2012)
Old 07-18-2012, 01:21 PM   PM User | #3
iainmcewan21885
New to the CF scene

 
Join Date: Jun 2012
Posts: 5
Thanks: 3
Thanked 0 Times in 0 Posts
iainmcewan21885 is an unknown quantity at this point
Thanks for replying!

I have updated both the lightbox.js and prototype.js to the most recent versions.

If I were to go through lightbox.js (or prototype.js) and replace the instances of $(etc...) with jQuery(etc...) would that solve the problem?

sorry I am quite new at this.

Thanks again

Iain

Last edited by iainmcewan21885; 07-18-2012 at 01:23 PM..
iainmcewan21885 is offline   Reply With Quote
Old 07-18-2012, 01:48 PM   PM User | #4
VIPStephan
The fat guy next door


 
VIPStephan's Avatar
 
Join Date: Jan 2006
Location: Halle (Saale), Germany
Posts: 7,614
Thanks: 5
Thanked 865 Times in 842 Posts
VIPStephan is a jewel in the roughVIPStephan is a jewel in the roughVIPStephan is a jewel in the rough
Quote:
Originally Posted by iainmcewan21885 View Post
If I were to go through lightbox.js (or prototype.js) and replace the instances of $(etc...) with jQuery(etc...) would that solve the problem?
They are two different JS frameworks that are incompatible. The noConflict function of jQuery is just fixing the symptoms and should only be used as very last resort if you have no influence on which libraries are there or might be added.

The best solution would be to choose one framework only and stick with it. There is a plugin for nearly everything for both frameworks, I suppose, so no need to use a protoype plugin and a jQuery plugin on the same site. Plus, by adding both you are adding a lot of redundant overhead code to the site.
__________________
Don’t click this link!
VIPStephan is offline   Reply With Quote
Users who have thanked VIPStephan for this post:
iainmcewan21885 (07-18-2012)
Old 07-18-2012, 02:39 PM   PM User | #5
iainmcewan21885
New to the CF scene

 
Join Date: Jun 2012
Posts: 5
Thanks: 3
Thanked 0 Times in 0 Posts
iainmcewan21885 is an unknown quantity at this point
Thanks Andrew,

so I have gotten rid of prototype.js

Everything still works fine on firefox but IE is still just jumping to the image file as well as giving me this error now...

SCRIPT5007: Object expected
lightbox.js, line 345 character 3

line 345 seems to contain...
$(function() {

Thanks for all the help
iainmcewan21885 is offline   Reply With Quote
Old 07-18-2012, 05:41 PM   PM User | #6
AndrewGSW
Senior Coder

 
Join Date: Apr 2011
Location: London, England
Posts: 2,120
Thanks: 15
Thanked 354 Times in 353 Posts
AndrewGSW will become famous soon enough
Make sure that you have removed all references to prototype and uploaded/updated all the relevant files.

Firefox might be displaying correctly, but does it have any error messages that might help? Press F12 to start FireBug (installed?) and refresh the page if necessary. The bottom-right corner, or the Console, will reveal any error messages.
__________________
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
Validate your HTML and CSS
AndrewGSW is offline   Reply With Quote
Old 07-18-2012, 06:19 PM   PM User | #7
AndrewGSW
Senior Coder

 
Join Date: Apr 2011
Location: London, England
Posts: 2,120
Thanks: 15
Thanked 354 Times in 353 Posts
AndrewGSW will become famous soon enough
I believe scriptaculous is dependant upon prototype(?) as well, so you should remove all references to this as well.

Of course, this is all assuming that neither are needed or used anywhere in your code.

But is your lightbox.js a jQuery or prototype plug-in?
__________________
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
Validate your HTML and CSS

Last edited by AndrewGSW; 07-18-2012 at 06:22 PM..
AndrewGSW is offline   Reply With Quote
Reply

Bookmarks

Tags
bug, internet explorer, lightbox

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:33 PM.


Advertisement
Log in to turn off these ads.