Scott, I guess I did not make myself clear. What I try to do is to include a JavaScript library so I do not need to code functions defined in the library again. For example, I can use Math.sin(x) directly from the library.
Mingzhen On Apr 16, 3:35 pm, Scott Henninger <[email protected]> wrote: > Mingzhen; There is no need to try to include the Javascript file in > Composer or Eclipse or a Workspace. > > It works the other way around. Given a SPIN function that names a > JavaScript function, all you need is a valid pointer (pathname/URL) to > the file in spinx:javaScriptFile. > > So all you need is a valid way to address the file. For example, it > can be a URL to a file on a remote server. > > -- Scott > > On Apr 16, 2:55 pm, mwz <[email protected]> wrote: > > > > > Hi Scott, > > > I got the function part work for me. My question is: how I can add a > > javaScript library so I can use functions defined in the library. > > > I tried to follow the help file from TopBraid, which led me to check > > the properties of the project (which makes great sense to me because I > > had same experience when I used Eclipse development environment), > > items in my project properties are different from those described in > > the help file. There is no item for 'JavaScript' and 'JavaScript > > Libraries' so you can add or delete runtime library. There are only > > 'resource', 'builders', 'project references', 'refactoring history', > > 'run/debug setting', 'task tags' and 'valiation'. > > > I want to know what I should do to solve the problem. > > > I hope I described the issue clearly to you. Thank you for help. > > > Mingzhen > > > On Apr 16, 1:31 pm, Scott Henninger <[email protected]> > > wrote: > > > > Mingzhen; What exactly do you mean by "'JavaScript' bar" and "as > > > shown in the help section of advanced javascript topic"? > > > > In terms of adding a JavaScript file, the way it works in Composer is > > > that you provide a URL for a JavaScript file in the > > > spinx:javaScriptFile. I.e. just like a Web page would address a js > > > page. > > > > Working from a defined JS file, the way to create a SPIN function for > > > a function myJSfunc() from the filehttp://myserver.org/myJSfunctions.js > > > would be as follows: > > > 1. Create a subclass of spin:Functions named myJSfunc > > > 2. Insert "http://myserver.org/myJSfunctions.js" in a value for > > > spinx:javaScriptFile > > > > The details are if arguments are passed and defining the return type. > > > > -- Scott > > > > On Apr 16, 10:54 am, mwz <[email protected]> wrote: > > > > > Hi, > > > > > I am having problem to import a JavaScript library so I can use > > > > functions defined in them. I looked at the project properties (by > > > > right clicking on the project), there is no 'JavaScript' bar to expand > > > > as shown in the help section of advanced javascript topic. > > > > > What could I do for the system to get the featuer I need? Thank you > > > > veyr much. > > > > > Mingzhen- Hide quoted text - > > > > - Show quoted text -- Hide quoted text - > > - Show quoted text - --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TopBraid Composer Users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/topbraid-composer-users?hl=en -~----------~----~----~----~------~----~------~--~---
