cancel
Showing results for 
Search instead for 
Did you mean: 

including .js from scripts folder to iView

lakshmikanthaiah_s
Participant
0 Kudos
101

Dear friends

I tried the codes as below to include .js file of script folder to iView

1.

<script src="/irj/portalapps/Kemvision/scripts/portal.js"></script>

2.

<%

String url = componentRequest.getWebResourcePath() + "/scripts/portal.js";

%>

<script src="<%=url%>"></script>

3.

<%String componentName = componentRequest.getComponentContext().getComponentName();String baseURL = componentRequest.getWebResourcePath(componentName);%><script language="JavaScript" src="<%= baseURL %>/scripts/porta.js"></script>

but no code are usefull to include the .js file into iView

can anybody got solution plz reply me

thanx

kantha

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Kantha,

try the following code:

<%

String url = componentRequest.getResource(com.sapportals.portal.prt.resource.IResource.SCRIPT,"scripts/portal.js").getResourceInformation().getURL(componentRequest);

%>

<script language=javascript src="<%= url %>"></script>

Ranjith.

Answers (0)