On Tuesday, July 24, 2001, at 03:28 PM, Gregory Dobkins wrote:
> I am having trouble using ECS to use a JavaScript library file. I've read
> the earlier append but it did not help me. I am using Visual Cafe 4.5 and
> WebLogic 6.0. I've placed the genutil.js file in what I believe is the
> appropriate directory. (it loads ok, if I change the name of the file it
> can't find the file and won't load) I've been able to imbed JavaScript
> from the servlet but not from the libary file. I tried adding another
> .addElement after the setSrc. It put text in the area I expected the
> JScript but not the contents of the library. What am I doing wrong?
(before i start i'd like to apologize for my complete ignorance of
javascript.
if there's a javascript master out there, then please feel free to jump in)
i've run your code and ecs is performing as i'd expected.
> I placed genutil.js in c:
> \WebGain\bea\wlserver6.0spq\config\mydomain\applications\DefaultWebApp_myserver
> and called it using ECS by,
>
> Html mainPage = new Html()
> .addElement(new Head()
> .addElement(new Title("Entry Form"))
> .addElement( new Script()
> .setLanguage("JavaScript")
> .setSrc("/genutil.js"))
>
> .addElement(new Script() // this section works fine
> .setLanguage("JavaScript")
> .addElement("function checkNum(input){ " +
> " if ( ! isNaN(input.value) ) { " +
> " return; }" +
> " else { " +
> " window.alert('Non-numeric input!'); " +
> " gotoItem(input); } }" )))
>
> It compiled ok and did not state that it couldn't find genutil.js when
> loaded into the browser (Netscape)... but the source looked like this.
> How
> do I get my library file be included between the <!- //-> ?
if i understand you correctly...
i think the problem is that you expect ecs to do too much :)
ecs is just generates correctly formatted text from the object model.
the setSrc method simply sets the src attribute - it doesn't do anything
fancy like loading files. if you want the contents of the file to be
outputted between <!- //-> you'll need to load the contents of the file in
question yourself - and then add an element containing them.
- robert
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]