Forum Stats

  • 3,874,171 Users
  • 2,266,675 Discussions
  • 7,911,750 Comments

Discussions

Javascript not able to access static files in Oracle Apex

user1985769
user1985769 Member Posts: 10 Blue Ribbon

I am using Oracle Apex 22.1, ORDS 22.3, Tomcat 8.

The CSS file in the Static Application File #APP_FILES# can be accessed by the Oracle Apex Page. But when I try to access it with the Javascript, it is not able to do so.

I am trying to use the CSS file in the Javascript to print file. Please see my javascript below:

var prtContent = document.getElementById("print-report-card");

var WinPrint = window.open('', 'mark-card', 'left=20,top=20,width=800,height=1200,toolbar=0,scrollbars=1,status=0');


WinPrint.document.write(prtContent.innerHTML);

WinPrint.document.write('<html><head>');

WinPrint.document.write('<link rel="stylesheet" href="#APP_FILES#css/school_markcard.css" />');

WinPrint.document.write('</head><title></title><body >');

WinPrint.document.write('</body></html>');

WinPrint.document.title = document.getElementById("file-name").innerText;

WinPrint.document.close();

WinPrint.focus();

WinPrint.print();

WinPrint.close();