Skip to main content

Search and Top Navigation

#7628 closed bug (worksforme)

Opened August 10, 2011 08:42PM UTC

Closed September 06, 2011 10:34PM UTC

Datepicker fails in IE9 when <base> tag is set

Reported by: iamwyza Owned by:
Priority: minor Milestone: 1.9.0
Component: ui.datepicker Version: 1.8.10
Keywords: Cc:
Blocked by: Blocking:
Description

If the <base href> tag is set on a page where datepicker resides, and the page where the datepicker is not the value of base href, then when clicking on a day in IE it will act as a true link and go to the href page. I solved this by adding a little code to the _generateHTML method of the datepicker class.

var printDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1 - leadDays));

Local code to handle the base tag

var href = '#';

if ($('base').length != 0) {

var loc = window.location + '';

if (loc.match('#')) {

href = loc;

} else {

href = loc + '#';

}

}

end local code part 1

for (var dRow = 0; dRow < numRows; dRow++) { create date picker rows

...cut...

changed # to href as defined above.

'" href="' + href + '">' + printDate.getDate() + '</a>')) + '</td>'; // display selectable date

Attachments (0)
Change History (2)

Changed August 10, 2011 08:45PM UTC by iamwyza comment:1

Sorry the code didn't paste right....


var printDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1 - leadDays));
 
//Local code to handle the base tag 


var href = '#'; if ($('base').length != 0) { 
var loc = window.location + '';
if (loc.match('#')) { 
href = loc; 
} else { 
href = loc + '#'; 
} 
} 

//end local code part 1 


for (var dRow = 0; dRow < numRows; dRow++) { create date picker rows 


Changed September 06, 2011 10:34PM UTC by scottgonzalez comment:2

resolution: → worksforme
status: newclosed

I'm not seeing any problems. Datepicker never actually follows any of those links. If you continue to have problems, please provide a reduced test case showing the bug.