Skip to main content
1-Visitor
July 26, 2011
Question

Custom JavaScript in WIndchill 10

  • July 26, 2011
  • 7 replies
  • 2817 views
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

13-Aquamarine
July 26, 2011
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]
12-Amethyst
July 26, 2011
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
1-Visitor
July 26, 2011

hi,



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


thnaks

1-Visitor
July 26, 2011
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
1-Visitor
July 27, 2011
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 .
12-Amethyst
July 27, 2011
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
1-Visitor
July 27, 2011

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