How can use an external script file ?

P

Patrick

Hi

I want to use script files which are shared on another server. How can i use
them on my Infopath form's script ?

Can i include script files as resources of my form ? and if yes, how can i
use them on my code ?
Thx
 
P

Patrick

ok. I find how to do a task panel (taskpane.htm for instance) so no problem
to load by a src, a script file which includes some functions.

Is there an option to render invisible the task pane other by code ? 'cos i
do it on the
XDocument::OnSwitchView function. But if the computer is slow, we see a
little the task pane before it is closed.

Then, you said me i can include the scripts file as resources for the form
by changing the .xsf and listing it in the xsf:scripts section. Then i'll be
able to call from script.js to myscript.js. How do you do the call by script
please ? Have you a sample code to do that ?

Thx again. (I'm so bad on script langage :( !!!)


Patrick said:
OK thx.

I'll try them, but how can i have a task panel ???


Greg Collins said:
You can use an external file... but so far as I know it must be part of the .XSN to work. The trick is to add it as a resource, and then go into the manifest.xsf file and list it in the xsf:scripts section. Then you can call from script.js to myscript.js.

But this doesn't sound like what you want to do. Although this allows you to have an extra script file, you must still include it as part of the .XSN which means that each form must be updated when the script file changes.

There are some other possibilities I haven't tried yet. If you try them, please let me know how they work.

1. If you have (or can have) a Task Pane, you might be able to load and reference the http:// script file from there and then possibly access it from your form.
2. You might be able to find some way to load it from your script.js file into a DOM, or something else, during OnLoad, and then access the functions in it.

There might be other ways, and I haven't tried either of these. Let us know if you find a way.

--
Greg Collins [InfoPath MVP]
Please visit: http://www.InfoPathDev.com



Hi

I want to use script files which are shared on another server. How can i use
them on my Infopath form's script ?

Can i include script files as resources of my form ? and if yes, how can i
use them on my code ?
Thx
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top