cancel
Showing results for 
Search instead for 
Did you mean: 

specifying source file name

Former Member
0 Kudos

Hi,

We have a javascript form validation program that we would like to use in our BSP applications. Unless I include this in every BSP application it does not work. I have tried specifying this using the src="xxxx.js" within the tag and does not work. Anythoughts?

Albert

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Yes, I have tried it.

Albert

athavanraja
Active Contributor
0 Kudos

just right click on your BSP and click create->MIME object->import and import the js from your local file and then refrence it in your page immediately after the htmlb:content tag or within htmlb:documenthead


 sc ript typ e="text /java script" sr c ="js filenam e .j s">< / scr ipt

Answers (4)

Answers (4)

Former Member
0 Kudos

Yes, I have uploaded the source file into the MIME repository using the program BSP_UPDATE_MIMEREPOS.

Albert

Former Member
0 Kudos

Hi,

Try using:

script language="javascript" src="MyJavascript.js"/script

If your file is in the MIME Repository corresponding to your BSP application (/sap/bc/bsp/sap/zapplication), this should work.

Regards,

Tanguy

Former Member
0 Kudos

BTW, looks like I cannot post anything with script tag, and so I removed the < >.

Albert

Former Member
0 Kudos

Hi,

I was trying to, but looks like I cannot post javascript code.

Here is my sample code.

<htmlb:content design="classicdesign2002design2003" >

<htmlb:document>

<htmlb:documentHead title="Title" >

<%@ include file="MyJavascript.js"%>

.

</htmlb:documentHead>

<htmlb:documentBody marginLeft="100" marginRight="50">

.

.

.

</htmlb:documentBody>

</htmlb:document>

</htmlb:content>

The above works. However, if I use

<htmlb:content design="classicdesign2002design2003" >

<htmlb:document>

<htmlb:documentHead title="Title" >

script language="javascript" src="/SAP/BC/BSP/SAP/ZAPPLICATION/MyJavascript.js"/script

.

</htmlb:documentHead>

<htmlb:documentBody marginLeft="100" marginRight="50">

.

.

.

</htmlb:documentBody>

</htmlb:document>

</htmlb:content>

does not work.

my javascript file does not have script tags.

Albert

Former Member
0 Kudos

Hi,

Before you can use:

script language="javascript" src="/SAP/BC/BSP/SAP/ZAPPLICATION/MyJavascript.js"/script

you have to upload your file in the MIME Repository. Have you done so, or did you put your JS file as a BSP page in your application?

The code above should work if your JS file is in the MIME repository.

Regards,

Tanguy

Former Member
0 Kudos

Hi,

I am not sure I understood well your question, but maybe you could use page fragments.

Put your javascript code into a page fragment, and include it in your BSP applications.

Hope it is relevant...

Regards,

Tanguy