PDA

View Full Version : Probably something simple - Dynamic AJAX Content in Safari



Riley S
12-11-2008, 05:45 AM
I'm using two scripts from Dynamic Drive - Dynamic AJAX Content (http://www.dynamicdrive.com/dynamicindex17/ajaxcontent.htm) and Image Thumbnail Viewer (http://www.dynamicdrive.com/dynamicindex4/thumbnail.htm) - on my site http://www.rileyspiller.com/coasttocoast/. It's kind of a photo-blog site. Each blog entry will have a little table of thumbnails which you click for larger view using the Image Thumbnail Viewer script.

http://www.rileyspiller.com/coasttocoast/images/Picture%201.png

It works great as is in FF but I'm having an issue with Safari (the latest version - 3.1.2). When I first load the page the Image Thumbnail Viewer script doesn't work properly in the Dynamic AJAX Content box. Now, oddly, if I refresh the page once it's loaded the first time it works. This is boggling me because I know it's capable of functioning correctly (even without a refresh) in Safari because I copied the table of thumbnails to the bottom of the page (you'll see it if your scroll down), outside of the Dynamic Content window, and it works. It's just when it's used with the Dynamic Content box that it doesn't work.

It's something to do with the interaction between the two scripts. They pretty simple scripts and a smart coder could probably figure it out right away.

Thanks for your help.

URL: http://www.rileyspiller.com/coasttocoast/

jscheuer1
12-11-2008, 05:51 AM
Worked first time in Safari 3.1.2 here, perhaps you just need to clear your cache.

Riley S
12-11-2008, 05:01 PM
Hmm... I just cleared cache, no change. Are you sure?

Remember, it works fine when you refresh the page, so it has to just be the first time... and also, to test, click the "Riley" link at the top and test them on that page.

Thanks.

jscheuer1
12-11-2008, 05:17 PM
I didn't realize I had to click on the "Riley" link. It doesn't work in Opera or FF here either, and here no amount of refreshing will make it work in Safari. Generally AJAX imported content must be initialized before it will work in any browser. Scripts can be rewritten to listen to the page, and this will overcome that issue in many cases. However, that can be quite complicated, as can be finding a way to reinit (or often it must be a limited reinit) after import, which is another strategy for dealing with the issue. Lightbox 2.04a already listens to the page:

http://www.dynamicdrive.com/forums/showthread.php?p=163470#post163470

so will work fine with AJAX imported content that bears its syntax, and it can be configured to look a lot like Image Thumbnail Viewer. But it's so similar to begin with (in appearance) that you might be happy with it 'as is'.

Riley S
12-20-2008, 09:20 AM
You're a wonderful person.

Thanks a million.