mt_100
asked on
JavaScript redirect to local file
Currently there is an application running that was written in house. In the application there is a JavaScript redirect that will open a PDF file off the local machine, the code is below.
The code worked great on all platforms until XP SP2 came along and then it stopped working and we get a "page cannot be displayed" error. We have tried turning off the pop-up blocker and that wasn't it, so any help would be appreciated.
Can anyoen help with what setting we need to change in IE to get this to work again? Here is the code.
/**
* buildMidwestActivityReport LinkUrl
*
* JavaScript function that builds the Midwest Activity Report link URL with the
* parameters required for the servlet.
*
* Author: Janardan Kortikere
*/
function buildMidwestActivityReport LinkUrl()
{
var sortDirectionsList = document.midwestActivitySo rtFilterFo rm.sortDir ectionsLis t.value;
var hiddenFilterProjectStatusI d = document.midwestActivitySo rtFilterFo rm.hiddenF ilterProje ctStatusId .value;
var hiddenFilterBuildingCode = document.midwestActivitySo rtFilterFo rm.hiddenF ilterBuild ingCode.va lue;
var filterDoneByDateFromOffset = document.midwestActivitySo rtFilterFo rm.filterD oneByDateF romOffset. value;
var filterDoneByDateToOffset = document.midwestActivitySo rtFilterFo rm.filterD oneByDateT oOffset.va lue;
var filterDoneByTimeFrom = document.midwestActivitySo rtFilterFo rm.filterD oneByTimeF rom.value;
var filterDoneByTimeTo = document.midwestActivitySo rtFilterFo rm.filterD oneByTimeT o.value;
var midwestActivityReportLink =
'<%= UrlBuilder.getServletRoot( ) %><%= ApplicationConstants.SERVL ET_PRINT_M IDWEST_ACT IVITY_REPO RT %>'
+ '?<%= ApplicationConstants.ACTIO N %>=<%= ApplicationConstants.ACTIO N_PREVIEW %>'
+ '&sortDirectionsList=' + sortDirectionsList
+ '&hiddenFilterProjectStatu sId=' + hiddenFilterProjectStatusI d
+ '&hiddenFilterBuildingCode =' + hiddenFilterBuildingCode
+ '&filterDoneByDateFromOffs et=' + filterDoneByDateFromOffset
+ '&filterDoneByDateToOffset =' + filterDoneByDateToOffset
+ '&filterDoneByTimeFrom=' + filterDoneByTimeFrom
+ '&filterDoneByTimeTo=' + filterDoneByTimeTo
+ '&sortField1=' + document.midwestActivitySo rtFilterFo rm.sortFie ld1.value
+ '&sortField2=' + document.midwestActivitySo rtFilterFo rm.sortFie ld2.value
+ '&sortField3=' + document.midwestActivitySo rtFilterFo rm.sortFie ld3.value
+ '&sortField4=' + document.midwestActivitySo rtFilterFo rm.sortFie ld4.value
+ '&sortField5=' + document.midwestActivitySo rtFilterFo rm.sortFie ld5.value;
return midwestActivityReportLink;
}
/**
* showMidwestActivityReportI nNewWindow
*
* JavaScript function that displays the Midwest Activity Report in a new window.
*
* Author: Janardan Kortikere
*/
function showMidwestActivityReportI nNewWindow ()
{
midwestActivityReportWin=w indow.open ("",
'midwestActivityReportWin' ,toolbar=0 ,scrollbar s=1,locati on=0,statu s=0,menuba r=0,resiza ble=1,widt h=975,heig ht=700,lef t=0,top=0' );
midwestActivityReportWin.d ocument.wr ite("<head ><title>Mi dwest Activity Report<\/title><\/head>");
midwestActivityReportWin.d ocument.wr ite('<h1>' + 'Retrieving report data .... please wait' + '</h1>');
newURL=buildMidwestActivit yReportLin kUrl();
setTimeout('midwestActivit yReportWin .location. href=newUR L;', 1000);
}
The code worked great on all platforms until XP SP2 came along and then it stopped working and we get a "page cannot be displayed" error. We have tried turning off the pop-up blocker and that wasn't it, so any help would be appreciated.
Can anyoen help with what setting we need to change in IE to get this to work again? Here is the code.
/**
* buildMidwestActivityReport
*
* JavaScript function that builds the Midwest Activity Report link URL with the
* parameters required for the servlet.
*
* Author: Janardan Kortikere
*/
function buildMidwestActivityReport
{
var sortDirectionsList = document.midwestActivitySo
var hiddenFilterProjectStatusI
var hiddenFilterBuildingCode = document.midwestActivitySo
var filterDoneByDateFromOffset
var filterDoneByDateToOffset = document.midwestActivitySo
var filterDoneByTimeFrom = document.midwestActivitySo
var filterDoneByTimeTo = document.midwestActivitySo
var midwestActivityReportLink =
'<%= UrlBuilder.getServletRoot(
+ '?<%= ApplicationConstants.ACTIO
+ '&sortDirectionsList=' + sortDirectionsList
+ '&hiddenFilterProjectStatu
+ '&hiddenFilterBuildingCode
+ '&filterDoneByDateFromOffs
+ '&filterDoneByDateToOffset
+ '&filterDoneByTimeFrom=' + filterDoneByTimeFrom
+ '&filterDoneByTimeTo=' + filterDoneByTimeTo
+ '&sortField1=' + document.midwestActivitySo
+ '&sortField2=' + document.midwestActivitySo
+ '&sortField3=' + document.midwestActivitySo
+ '&sortField4=' + document.midwestActivitySo
+ '&sortField5=' + document.midwestActivitySo
return midwestActivityReportLink;
}
/**
* showMidwestActivityReportI
*
* JavaScript function that displays the Midwest Activity Report in a new window.
*
* Author: Janardan Kortikere
*/
function showMidwestActivityReportI
{
midwestActivityReportWin=w
'midwestActivityReportWin'
midwestActivityReportWin.d
midwestActivityReportWin.d
newURL=buildMidwestActivit
setTimeout('midwestActivit
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.