Thank you for being a valued part of the CNET community. As of December 1, 2020, the forums are in read-only format. In early 2021, CNET Forums will no longer be available. We are grateful for the participation and advice you have provided to one another over the years.

Thanks,

CNET Support

Question

When I try to click and launch some of the links set to open

Nov 12, 2013 5:27PM PST

Hi all,

For the past few days, we are facing issue with the chrome browser behavior. This is related to opening links set to open in new tab/window. The details are as follow:

I have a collection of links and each link points to different resource to be opened in a new tab/window. The code is as follow:

<a class="cssClass" rid="1114931" href="http://www.domain.com/resources/abc.html" title="Link1" tabindex="4">Link 1</a>

And there are few checks/filters over accessing the resources which have been implemented as onClick handler over the links. In case any of the validations fails, the onClick handler returns false and the default behavior of the link does not happens i.e. links does not get open.

One of such (last) checks includes AJAX call in sync mode. The code is as follow:

....
....

var link_clickHandler = function(evt/* Event */) {
var objTarget = jQuery(evt.target);

if(check1) {
return false;
}
else if(check2) {
return false;
}
else if(check3) {
var blnRetVal = false;

jQuery.ajax( {
"async" : false,
"type" : "GET",
"contentType" : "application/json; charset=utf-8",
"url" : "index.php",
"data" : 'resourceid=' + intResourceId,
"dataType" : "json",
"forceData" : true,
"success" : function(data) {
if(check1) {
blnRetVal = true;
}
}
"error" : function(error) {
}
} );

return blnRetVal;
}
};

jQuery("a.cssClass").live("click", link_clickHandler);


ISSUE: The issue is that Chrome is behaving in very weirdly manner. In case all of the checks are passed and onClick handler returns true, sometimes the resource get opened in a new tab/window and sometimes it get opened as a pop-up (which should never). Tried to capture any pattern but could not succeed.

Any solution or even helping in understanding behavior would be really appreciated.

Thanks & Regards,
Test Developer.

Discussion is locked

- Collapse -
Answer
Not an answer but an observation.
Nov 14, 2013 2:17AM PST

At the office a new Windows 8 laptop arrived and odd things were going on. Later when we install VS2008, McAfee was stopping the copying of files in the projects and well, that was the end of that suite. But I noticed links that didn't click now worked. This is far from scientific since I didn't track it down, repeat the tests but it did show that client actions and clicks can be machine/configuration independent.

I think you need to try this on more than one PC with variations of OS and "protection." It may not be any bug in code.
Bob

- Collapse -
Answer
(NT) Any help or clue guys?
Nov 14, 2013 11:14AM PST
- Collapse -
If it works in other browsers.
Nov 16, 2013 2:29AM PST
- Collapse -
Answer
Any clue?
Nov 27, 2013 2:41PM PST

Is there anyone who have also encountered such issue(s)? Is there any clue?