|
|
||||||
|
||||||
| Index Link To US Private Messages Archive FAQ RSS | ||||||
| Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome. |
Share Thread: & Tags
|
||||
|
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Hello, I am trying to add a lightbox feature to a page on my site and on my local server it works fine, but when loaded to my webserver it does not work.
The page: Island Club Resorts - Belize Yacht Club, Belize Resort, San Pedro, Ambergris Caye Vacation The icons next to the room descriptions in the rates should open a lightbox with a couple of images. I look at the JS errors and it indicates that a bit of JS used on my index page is what is causing the error, but not sure if that is the issue or not. Any help please.
__________________
Rob |
|
||||
|
I assume this is what makes the error:
HTML Code:
<td valign="top" width="180"> <a href="resortpictures/byc/06Oceanview Suite - 2 Queens/164.jpg" title="Luxurious Queen Beds and open spaces." rel="lightbox[OVFS]"> Ocean View Family Suite <img style="float:right;" src="http://www.webproworld.com/images/icon_picture.png" alt="See Room" /> </a> <a href="resortpictures/byc/06Oceanview Suite - 2 Queens/249.jpg" title="Incredible views looking across the courtyard out to the Caribbean Sea and Barrier Reef!" rel="lightbox[OVFS]"> </a> </td>
__________________
Mini Network:: Financial information at your fingertips Learn object oriented programming where it started Last edited by kgun; 07-09-2009 at 07:31 AM. |
|
||||
|
Certainly the JS error will stop your code. In Firefox I see:
Error: document.getElementById("ajax-banner_home") is null Source File: http://islandclubresorts.com/ajax-banner_home.js Line: 46 |
|
||||
|
I did not look at the JS file
![]() Line 46. Code:
document.getElementById('ajax-banner_home').innerHTML = html_content;
|
|
|||
|
So how do I resolve that? The 'ajax-banner_home' is only required for the home page, but it has to be placed in the head of the file which is a header include used across the entire site.
Any ideas?
__________________
Rob |
|
|||
|
Hmmm... Okay so I set up a php if statement to only call the ajax-banner_home if it is the home page. However this still does not make the lightbox work?
On a positive note though it appears to have eliminated the JS error that was showing up??!!?? which has me even more confused.
__________________
Rob |
|
|||
|
IE8 shows this for the page...
Webpage error details User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.21022; WWTClient2; .NET CLR 3.5.30729; .NET CLR 3.0.30618; OfficeLiveConnector.1.4; OfficeLivePatch.0.0) Timestamp: Thu, 9 Jul 2009 19:42:48 UTC Message: Object required Line: 493 Char: 9 Code: 0 URI: http://islandclubresorts.com/images/...dynCalendar.js Message: Object required Line: 493 Char: 9 Code: 0 URI: http://islandclubresorts.com/images/...dynCalendar.js Message: Object required Line: 493 Char: 9 Code: 0 URI: http://islandclubresorts.com/images/...dynCalendar.js Message: Object required Line: 493 Char: 9 Code: 0 URI: http://islandclubresorts.com/images/...dynCalendar.js Message: Object required Line: 493 Char: 9 Code: 0 URI: http://islandclubresorts.com/images/...dynCalendar.js |
|
|||
|
You might want to make the Island Club Resorts logo link to the home page. It was the second thing I clicked on. When it didn't work as expected I then went searching for the top nav.
Take a look at your img alt text too. They seem to be completely missing everywhere. The links in your nav could use some title text. So when you hover over the BYC link it says "Belize Yacht Club". Keeps the nav tidy but friendly. A visitor shouldn't have to click a link to figure out what it is for. |
|
|||
|
Okay, but what does the dynCalendar.js and the nav structure have to do with the lightbox problems that I am having?
need helping figuring out why it works on my local server and not on the live server? Any ideas?
__________________
Rob |
|
|||
|
Just messing in IE8 switching back and forth from compatibility mode the lightbox is interacting with the calendar when I click the description links. The date fields disappear from the calendar once clicked.
Try disabling the calendar to see if the lightbox starts working. That should point you in the right direction. The errors I listed earlier should be a clue. I don't have time to dig into it but I hope this helps somewhat. |
|
|||
|
In addtion to any javascript problems, you may have a filename syntax problem. When I try to get to the pictures, I get a 404 error:
Quote:
|
|
|||
|
In native IE8 mode when I hover over most of the images on the home page (like the Summer Specials ad) it displays next to the pointer some text to better describe the link/image. When I put IE8 in compatibility mode all those stop working. The pointer just sits there with no little text message.
I always referred to them as "tool-tips" but I think there is a different term for webpage UI tool-tips. |
|
|||
|
You can find out pretty quickly if the spaces in the filenames are part of the problem. Just rel="lightbox[]" the text part and not the img. That way a 404 can't freak out the lightbox.js.
Better explainagion below... Last edited by subsystems; 07-09-2009 at 07:08 PM. |
|
|||
|
I did some experimenting and found a couple of issues.
I checked out this page. Lightbox JS I dropped their lightbox.js link onto your code and removed the [OVFS] then used their link and img urls and things seemed to work. I tried to put your lightbox.js script url and it failed. I was also getting an undefined element error using your lightbox.js with the [OVFS] removed. I also found IF the A tag's href url is invalid the lightbox doesn't work. Even using the one from huddletogether. So unless you need the [OVFS] I'd replace your lightbox.js and make sure the full urls work in your links and images. I do mean actually pasting the url into your address bar and seeing if you get a 404. I am getting 404s off your larger image file even with the %20 codes in. This one... http://islandclubresorts.com/resortp...Queens/164.jpg This url actually works... http://islandclubresorts.com/resortp...Queens/164.JPG Here, save this code and check it out. <html> <head> <script type="text/javascript" src="http://www.huddletogether.com/projects/lightbox/lightbox.js"></script> </head> <body> <a href="http://islandclubresorts.com/resortpictures/byc/06Oceanview%20Suite%20-%202%20Queens/164.JPG" title="Luxurious Queen Beds and open spaces." rel="lightbox">Ocean View Family Suite 2<img style="float:right;" src="http://islandclubresorts.com/images/icon_picture.png" alt="See Room" /></a> <a href="http://islandclubresorts.com/resortpictures/byc/07Oceanview%20Suite%20-%20King/219.JPG" title="Luxurious King Bed and open spaces." rel="lightbox">Ocean View King Suite <img style="float:right;" src="http://islandclubresorts.com/images/icon_picture.png" alt="See more Images" /></a> </body> </html> This should narrow the issues down a bit. Oh, and your lightbox.css file doesn't exist even though you are referencing it. http://islandclubresorts.com/css/ Last edited by subsystems; 07-09-2009 at 07:42 PM. |
|
||||
|
Quote:
I reacted at this rel="lightbox[OVFS]" attribute the first time I saw it.
__________________
Mini Network:: Financial information at your fingertips Learn object oriented programming where it started Last edited by kgun; 07-09-2009 at 07:12 PM. |
|
||||
|
There are plenty of lightbox options out there. Some are more challenging than others. Is this the only one you've tried? I tested the site in Chrome and it's not working for me as far as the lightbox option is concerned.
I do recall having a few pains dealing with these, mostly human error in the coding
__________________
20% Off Online Stores | Flash CMS | Blogs | Templates * Follow Our Twitter! Online Since 2003 & TemplateMonster, Logos, Design Software, Custom Websites |
|
|||
|
hmmm... I will try these things and get back to you... regard which lightbox I have used it can be found here: Dynamic Drive DHTML Scripts- Lightbox image viewer 2.03
The [OVFS] you will see in the demo is just a method used to group pics together... the OVFS is a room type so I grouped two pics together. Will get back to you in the morning when I have a chance to trial some of these suggestions... thanks everyone!
__________________
Rob |
|
|||
|
Here is the developer's site. Lightbox 2
Substituting the code in the <head> gives the html below. I also just to test put lightbox[OVFS] for both links. Works nicely. The close gif in my test below was of course using the wrong url. Easy fix on a live page. <html> <head> <script src="http://www.lokeshdhakar.com/projects/lightbox2/js/prototype.js" type="text/javascript"></script> <script src="http://www.lokeshdhakar.com/projects/lightbox2/js/scriptaculous.js?load=effects,builder" type="text/javascript"></script> <script src="http://www.lokeshdhakar.com/projects/lightbox2/js/lightbox.js" type="text/javascript"></script> <link rel="stylesheet" href="http://www.lokeshdhakar.com/projects/lightbox2/css/lightbox.css" type="text/css" media="screen" /> </head> <body> <a href="http://islandclubresorts.com/resortpictures/byc/06Oceanview%20Suite%20-%202%20Queens/164.JPG" title="Luxurious Queen Beds and open spaces." rel="lightbox[OVFS]">Ocean View Family Suite 2<img style="float:right;" src="http://islandclubresorts.com/images/icon_picture.png" alt="See Room" /></a> <a href="http://islandclubresorts.com/resortpictures/byc/07Oceanview%20Suite%20-%20King/219.JPG" title="Luxurious King Bed and open spaces." rel="lightbox[OVFS]">Ocean View King Suite <img style="float:right;" src="http://islandclubresorts.com/images/icon_picture.png" alt="See more Images" /></a> </body> </html> This should get you going. Last edited by subsystems; 07-09-2009 at 10:34 PM. |
|
||||
|
Hopefully yes, but
Quote:
__________________
Mini Network:: Financial information at your fingertips Learn object oriented programming where it started Last edited by kgun; 07-10-2009 at 09:08 AM. |
|
||||
|
Dear WPW professionals.
Here is some language that I'm not familiar with that I've cut'N'pasted alongside some other bits I collected, that I also don't really understand. I'm hoping you'll do me a favour and tell me what the hell is going on and explain what I've done and perhaps provide me with some alternatives that give me some sort of functionality that I can stick in to what I'm trying to make so that I can... |
|
|||
|
You are welcome.
Actually it wasn't too hard to solve. I found a page that was working with the lightbox and sectioned out the code the developer was using. I created 2 html files on my desktop. One worked, one didn't. I changed each suspected difference one by one until it started working. Once I got it working I was able to experiment with which part of it was making it fail. Then I just copied the code from my working file and pasted it here. Just basic troubleshooting. I didn't feel like going through the lightbox.js file to find the exact error since I was able to find the developer's site. I just used his example files. Often times it is the results that count, not the effort involved. |
|
|||
|
Okay, I got it fixed... sort of...
I changed the page name for testing purposes so it can be viewed here: Island Club Resorts - Belize Yacht Club, Belize Resort, San Pedro, Ambergris Caye Vacation Got the lightbox to function on all of them, but for some reason, the first two room types don't load the pictures... I have finely gone over the URL for typos, I have tried absolute URLs, I have tried the %20 instead of spaces and I even removed the hyphen from the folder name as that was the only difference between the first two and the rest of them. No luck on the first two... any further ideas?
__________________
Rob |
|
||||
|
OK
No.1 http://www.islandclubresorts.com/res...yc/06Oceanview Suite 2 Queens/164.jpg No.2 http://www.islandclubresorts.com/res...yc/07Oceanview Suite King/219.jpg ... do not exist, or your server is refusing to give them out. It also reports 'a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.' No.3 http://www.islandclubresorts.com/resortpictures/byc/021 Bedroom Suite/inside_pics 017.jpg exists and is accessible through a browser. If you're absolutely certain that you haven't made any typo's... it's just possible the server, or JavaScript, doesn't like the purely numeric names for the first two jpgs (the other big difference). Personally I wouldn't use spaces in directorynames or filenames. You can see how just cutting and pasting your urls to here has broken them. JavaScript will probably suffer too. Last edited by Uncle Dog; 07-13-2009 at 03:51 PM. Reason: I'm pedantic |
|
|||
|
Okay... I figured out the problem... wow such a small oversight! the images are named with caps JPG extensions. so 164.jpg is NOT 164.JPG... sigh... but now it is functioning properly.
Many thanks to everyone for your help on this matter... greatly appreciated. (especally your satirical responses Uncle Dog - most ammusing!)
__________________
Rob |
|
||||
|
ackerly1: while the issue may not present itself anymore, your other obvious issue is still present. The one of pulling in the entire image javascript on every page when it is only need on the index page. If you can use php on the index, this will alleviate the issue.
Code:
<?php
if(eregi('index', $_SERVER[SCRIPT_FILENAME])){
echo '<script type="text/javascript" src="js/lightbox.js"></script>' . "\n";
}
?>
I am sure there should be a way of doing it in javascript as well, but that is a language I do not pay enough attention to. |
|
||||
|
Since javascript files are cached, it will only be loaded the first time a visitor hits one of your pages so I wouldn't worry about that too much.
I would however suggest you look at validating your pages as there are many HTML errors that may cause some little problems. |
|
||||
|
Quote:
I got a negative anonymous red rep point in this thread with the message. "nothing wrong with that code at all". I think without my initial fast comment, this thread would have drowned without any comment because of the very bad information in the first post. The thread was even put on the front page of WPW. Thank you anonymous commentator for your reputation building. I have still no time to program for other members, neither time to comment thoroughly on bad information.
__________________
Mini Network:: Financial information at your fingertips Learn object oriented programming where it started Last edited by kgun; 07-14-2009 at 10:08 AM. |
|
|||
|
Glad to hear you got it working.
I guess you didn't notice the .jpg .JPG that I pointed out in my links. Mine worked, your's didn't. Glad you finally spotted it. I hadn't checked back sooner because my system has been down waiting for parts to show up. I came home to find one of my cats sleeping in my open full tower case. With the system running of course and a black screen. I should have put that cover on before I left. It's on now. New MB and Power Supply later. grumble grumble LOL Then there is the always fun reactivation of Windows via phone... "Please read the installation code." It's only installed in 1 system. "Here is your activation code." "Please say continue. I didn't catch that. Please say continue. I didn't catch that. Please press 2 to continue" 2, 2, 2, 2, 2, 2, 2, 2, 2, next. What a pain. I've been through that about a dozen times on different systems replacing failed hardware. |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Contract Conflict! Now What? | shamarkaleo | Internet Industry | 96 | 08-15-2008 10:19 PM |
| .htaccess conflict between instruction | punkrazio | IT Discussion Forum | 9 | 06-13-2008 08:49 AM |
| Conflict | jacobwissler | Google Discussion Forum | 4 | 06-14-2006 02:45 AM |
| email server conflict | ldylion214 | IT Discussion Forum | 7 | 03-13-2006 04:01 AM |
| Personality Conflict | wenwilder | Graphics & Design Discussion Forum | 38 | 02-27-2005 07:56 PM |
|
WebProWorld |
Advertise |
Contact Us |
About |
Forum Rules |
MVP's |
Archive |
Newsletter Archive |
Top |
WebProNews
WebProWorld is an iEntry, Inc. ® site - © 2009 All Rights Reserved Privacy Policy and Legal iEntry, Inc. 2549 Richmond Rd. Lexington KY, 40509 |