Opened 8 years ago

Closed 8 years ago

#7628 closed bug (worksforme)

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

Change History (2)

comment:1 Changed 8 years ago by iamwyza

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 


comment:2 Changed 8 years ago by Scott González

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.

Note: See TracTickets for help on using tickets.