My Oracle Support Banner

Javascript Files are not Executed in WebCenter Portal when the Javascript File is Uploaded to Content Server (Doc ID 2917762.1)

Last updated on DECEMBER 28, 2022

Applies to:

Oracle WebCenter Portal - Version 12.2.1.4.0 and later
Information in this document applies to any platform.

Symptoms

Javascript (JS) files are not executed in WebCenter Portal when the Javascript File is uploaded to Content Server.


STEPS

The issue can be reproduced with the following steps:

  1. Connect to WebCenter Portal. 
     
  2. Navigate to the Documents page in a portal.
     
    • Upload a Javascript file (.js) to the Documents page in a portal.
       
    •  Select the Javascript file and click "Get Link" to get the document links.
       
    • Note down the Javascript file additional link.
      It should look like this:
       
      http://<HOST>:<PORT>/webcenter/content/conn/WebCenterSpaces-ucm/path/Enterprise Libraries/PortalTest/TestFile.js
       
    • Open a new browser window and enter the document URL.
      Confirm it downloads the file. 
       
  3. Create an HTML file and call the Javascript file inside the HTML file using the document additional link from the previous step.

    • Upload the HTML file to the Documents page in the Portal.
       
    • Select the Javascript file and click "Get Link" to get the document links.
       
    • Note down the html file additional link.
      It should look like this:

      http://<HOST>:<PORT>/webcenter/content/conn/WebCenterSpaces-ucm/path/Enterprise Libraries/PortalTest/Test.html
    • Open a new browser window and enter the html document URL.
      Notice the Javascript doesn't run.

  4. Upload the html file to OHS.
    • Get the Javascript URL from the http server.

    • Edit the HTML file and replace the Javascript URL with the one from the http server.

    • Check out the HTML file from the Portal and upload the new version.
       
    • Open a new browser window and enter the html document URL.
      Now the Javascript runs fine, so the issue is only when the Javascript file is uploaded to content server. 



Changes

 

Cause

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Symptoms
Changes
Cause
Solution
References


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.