MozillaZine


event handler prevents following link

Discuss how to use and promote Web standards with the Mozilla Gecko engine.
trolly
Moderator

User avatar
 
Posts: 39909
Joined: August 22nd, 2005, 7:25 am

Post Posted February 19th, 2015, 2:38 am

Hi,
the following event handler prevents following the link it is attached to. Does anyone have an idea why?

Code: Select all
this.trackExteralLink = function(event) {
  var $anchor = $(event.currentTarget);
  var url = $anchor.attr('href');
  // check if external link
  if (cnIvwHelper.checkIfExternalURL(url) === true) {
    var category = 'Outgoing Link';
    var action = 'click';
    // No Race Condition on new target ... just log the stuff.
    if (typeof($anchor.attr('target')) !== "undefined") {
      cnLog('Tracking External Click - in new Window');
      trackGAEvent(category, action, url, 0, false);
    } else {
      event.preventDefault();
      cnLog('Tracking External Click - in same Window');
      trackGAEvent(category, action, url, 0, false, (function() {
        setTimeout(function() {
          window.location = url;
        }, 200);
      }));
    }
  }
}


Page: http://www.glamour.de/glamunity/login
The link is
Code: Select all
<a href="http://www.glamour.de/login.php?do=lostpw" class="float-right">Passwort vergessen? &gt;</a>
Think for yourself. Otherwise you have to believe what other people tell you.
A society based on individualism is an oxymoron. || Freedom is at first the freedom to starve.
Constitution says: One man, one vote. Supreme court says: One dollar, one vote.

Dom1953
 
Posts: 52
Joined: July 24th, 2014, 6:02 am
Location: Australia

Post Posted February 19th, 2015, 9:07 pm

Hi Trolly,
Unfortunately this worked for me. Clicking the forgotten password link took me to the lost password page. This more or less immediately replaced itself with the main site home page. Clicking a menu item, Videos, again took me to a login page which, this time, replaced itself with the Videos page. Am I seeing the login/password page because of a slower network and/or PC perhaps?

trolly
Moderator

User avatar
 
Posts: 39909
Joined: August 22nd, 2005, 7:25 am

Post Posted February 20th, 2015, 3:08 am

You had JS enabled? Then maybe an addon causes the malfunction.

Thanks for the report.
Think for yourself. Otherwise you have to believe what other people tell you.
A society based on individualism is an oxymoron. || Freedom is at first the freedom to starve.
Constitution says: One man, one vote. Supreme court says: One dollar, one vote.

Dom1953
 
Posts: 52
Joined: July 24th, 2014, 6:02 am
Location: Australia

Post Posted February 20th, 2015, 4:32 pm

Yes to JS enabled. FWIW, today the "login.php?do=lostpw" link is serving up the forum main page immediately with no intermediary forgotten password page. The address bar and page history, however, both show the lost pw URL as the page address. I assume you know about this.

You're welcome.

trolly
Moderator

User avatar
 
Posts: 39909
Joined: August 22nd, 2005, 7:25 am

Post Posted February 20th, 2015, 4:37 pm

No, I didn't. When I click the link with JS disabled I get the lost pw page.
Think for yourself. Otherwise you have to believe what other people tell you.
A society based on individualism is an oxymoron. || Freedom is at first the freedom to starve.
Constitution says: One man, one vote. Supreme court says: One dollar, one vote.

Dom1953
 
Posts: 52
Joined: July 24th, 2014, 6:02 am
Location: Australia

Post Posted February 20th, 2015, 5:32 pm

I've retested with cleared caches and javascript both enabled and disabled and closing Firefox between changes.

It seems I was not recognizing the lost password page properly. I now do, after applying my limited German more fully with help of page visuals. My sincere apologies for this confusion.

What I can reproduce is that clicking the lost pw link navigates to the lost password page, irrespective of whether javascript is enable or disabled in my running of Firefox.

trolly
Moderator

User avatar
 
Posts: 39909
Joined: August 22nd, 2005, 7:25 am

Post Posted February 20th, 2015, 5:33 pm

Ok.
Thanks.

I guess I have to examine my addons.
Think for yourself. Otherwise you have to believe what other people tell you.
A society based on individualism is an oxymoron. || Freedom is at first the freedom to starve.
Constitution says: One man, one vote. Supreme court says: One dollar, one vote.

Return to Web Development / Standards Evangelism


Who is online

Users browsing this forum: No registered users and 1 guest