cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X

Custom JavaScript in WIndchill 10

vipindas_karuna
1-Newbie

Custom JavaScript in WIndchill 10

Hi ,

I have defined functions in "custom.js " and i am trying to include the
functions in the "custom .js" into my " customized.jsp" by adding the
following tag in the .jsp

<script type="text/javascript" <br="/>src="netmarkets/javascript/custom.js"></script>


But the jsp doesnt find the js file and its functions.

Although if i define the functions from the ".js" into the ".jsp" directly
, it finds the functions .

I even tried creating the "jsfrags " defined in the Windchill 10
Customization guide , but it didnt work either .


Has someone worked on" JavaScript" in Windchill 10 .


Thanks ,

Vipin .
7 REPLIES 7

Maybe put a "dot slash" in front of netmarkets?

src="./netmarkets/javascript/custom.js"

Patrick Williams | Engineering Systems | o: 616.698.3766 | c: 616.947.2110
[cid:image001.jpg@01CC4B8D.1A083840]

I would suspect the jsp compiler is collapsing the script tag try:

<script type="text/javascript" src="netmarkets/javascript/custom.js"></script>

In Firefox the JSView and Firebug addons let you see what has been loaded. I believe IE 8 and later will do the same thing with their Tools -> Developer Tools.


Craig Raymond
Windchill / Web Developer

BAE Systems
Intelligence & Security
Enterprise Technology Services
600 Main St, Johnson City, NY 13790

hi,



Use PTC.LoadScript("netmarkets/javascript/custom.js");


thnaks

Forgot to CC list...

Have not heard of the PTC.loadscript method suggested will have to try.

Original reply follows...

Sent from my Verizon Wireless BlackBerry

Hi Everyone,


The tag that worked

<script type="text/javascript" <br="/>src="../netmarkets/javascript/custom.js"></script>

i guess it was looking for one level above for the .js .


Special Thanks to David , Morkel ,Raymond and Williams for your help .


Thanks,
Vipin .

I'm wondering what the advantage of using the PTC.LoadScript method is?

Craig Raymond
Windchill / Web Developer

BAE Systems
Intelligence & Security
Enterprise Technology Services
600 Main St, Johnson City, NY 13790

hey sorry guys load script is something like this..



language = "text/javascript"


'netmarkets/javascript/test/mytest.js'

>










IE caches the responses for any js files loaded via PTC.navigation.loadScript() API


Top Tags