Link to home
Start Free TrialLog in
Avatar of mt_100
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.

/**
 * buildMidwestActivityReportLinkUrl
 *
 * JavaScript function that builds the Midwest Activity Report link URL with the
 * parameters required for the servlet.
 *
 * Author: Janardan Kortikere
 */
 
function buildMidwestActivityReportLinkUrl()
{
      var sortDirectionsList = document.midwestActivitySortFilterForm.sortDirectionsList.value;
      var hiddenFilterProjectStatusId = document.midwestActivitySortFilterForm.hiddenFilterProjectStatusId.value;
      var hiddenFilterBuildingCode = document.midwestActivitySortFilterForm.hiddenFilterBuildingCode.value;
      var filterDoneByDateFromOffset = document.midwestActivitySortFilterForm.filterDoneByDateFromOffset.value;
      var filterDoneByDateToOffset = document.midwestActivitySortFilterForm.filterDoneByDateToOffset.value;
      var filterDoneByTimeFrom = document.midwestActivitySortFilterForm.filterDoneByTimeFrom.value;
      var filterDoneByTimeTo = document.midwestActivitySortFilterForm.filterDoneByTimeTo.value;

      var midwestActivityReportLink =
            '<%= UrlBuilder.getServletRoot() %><%= ApplicationConstants.SERVLET_PRINT_MIDWEST_ACTIVITY_REPORT %>'
            + '?<%= ApplicationConstants.ACTION %>=<%= ApplicationConstants.ACTION_PREVIEW %>'
            + '&sortDirectionsList=' + sortDirectionsList
            + '&hiddenFilterProjectStatusId=' + hiddenFilterProjectStatusId
            + '&hiddenFilterBuildingCode=' + hiddenFilterBuildingCode
            + '&filterDoneByDateFromOffset=' + filterDoneByDateFromOffset
            + '&filterDoneByDateToOffset=' + filterDoneByDateToOffset
            + '&filterDoneByTimeFrom=' + filterDoneByTimeFrom
            + '&filterDoneByTimeTo=' + filterDoneByTimeTo
            + '&sortField1=' + document.midwestActivitySortFilterForm.sortField1.value
            + '&sortField2=' + document.midwestActivitySortFilterForm.sortField2.value
            + '&sortField3=' + document.midwestActivitySortFilterForm.sortField3.value
            + '&sortField4=' + document.midwestActivitySortFilterForm.sortField4.value
            + '&sortField5=' + document.midwestActivitySortFilterForm.sortField5.value;
      return midwestActivityReportLink;
}
/**
 * showMidwestActivityReportInNewWindow
 *
 * JavaScript function that displays the Midwest Activity Report in a new window.
 *
 * Author: Janardan Kortikere
 */
 
function showMidwestActivityReportInNewWindow()
{
      midwestActivityReportWin=window.open("",                   
            'midwestActivityReportWin',toolbar=0,scrollbars=1,location=0,status=0,menubar=0,resizable=1,width=975,height=700,left=0,top=0');
      midwestActivityReportWin.document.write("<head><title>Midwest Activity Report<\/title><\/head>");
      midwestActivityReportWin.document.write('<h1>' + 'Retrieving report data .... please wait' + '</h1>');
      newURL=buildMidwestActivityReportLinkUrl();
      setTimeout('midwestActivityReportWin.location.href=newURL;', 1000);      
}
ASKER CERTIFIED SOLUTION
Avatar of Roonaan
Roonaan
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial