PDA

View Full Version : curious behaviour (issues with non-IE browsers) [site link and partial code included]



Oseriduun
09-04-2008, 04:07 PM
Greetings folks, I'm working on a site redesign for an Online Radio Station, and have run into a bug i cannot explain nor find a fix for (as of yet). been searching for the last 3 days.

If you visit the above link, and click 'library' you will see a list of artists in a box on the left, a box to the right of that where it will display that bands albums, and a spot below where it will display songs / request information.

The Problem:
Works fine in IE, All other tested browsers require multiple clicks(2) to navigate the artist, album and song listings.

the page uses a mix of php, javascript, ajax, and the jQuery library to make things work.

The library page gets loaded when you hit the library key (as intended, first click). The artist box is auto-populated via mysql database.
each item is part of a <ul><li onclick="jquery code here"></li><ul>

------
Live Site
(removed)
------

the onclick code, using the artist list to album list


<li artistid="<?php echo urlencode($artist);?>" onClick="javascript:$(this).click(function() {
var artistid = $(this).attr('artistid');
artistclick(fixedUrl);
});">(artist name goes here)</li>


the artistclick function (this is in the main index.php, as is almost all the javascript code)


function artistclick(artistid) {
var buster = new Date();
var b2 = buster.getTime();
var fixedUrl = "albumlist.php?artistid=" + artistid + "&buster=" + b2;
// fetch(fixedUrl, "albums"); <-- old code, errors in all browsers except IE
$("#albums").load(fixedUrl); <-- new code, works in all browsers. jQuery
}


now mind you, even though $("#albums").load(fixedUrl); works, you have to click an artist name TWICE to have it actually load the album list to the next window. It works flawless in IE.. However the two-clicks-required bug has shown itself in FF (old and new versions) and Chrome (havn't tested other browsers yet, but i'm waiting from feedback from my testers who use different browsers)

if you need more code to look into, i'll be happy to post some, however i'd like to keep posted code to a minimum as this site is not yet open for public use.

at this point, i'm at a loss, i've checked over the code thoroughly, i've also tried swapping the list tag for <a> tags, <p> tags, and even different <h> tags.

Firefox's Error Console reports no errors, and i see no problems in the code while looking over it with FireBug plugin..

any idea's would be most appreciated.

Thanks in Advance,

Oser~
---------------------------

after 4 days of banging my head, a solution finally came to me. this thread is no longer valid.. (turns out IE was the one that was bugged and wasn't handling the triggers properly, where the rest were performing normal behaviour given the code being used.

magicyte
09-12-2008, 02:34 AM
Well, there is one little hint that I have for you:

JUST TO MAKE THINGS REALLY EASY, SIMPLY TELL YOUR SITE USERS TO CLICK ON WHAT YOU WANT THEM TO TWICE, OR ONCE.

-magicyte

rangana
09-12-2008, 05:03 AM
magicyte, you should have observed the edition reason of the OP (Resolved).

It was marked as resolved as he said, unluckily we were not lucky enough to be able to know the information.