JavaScript

T

TDC

Is there any way to add a JavaScript resource and access it from the
standard "script.js" file? (also looking to access other embedded resource
file(s) from the script.js like a configuration xml file).

Thanks in advance,

Tronn
 
T

TDC

Great! Might I have sample syntax?

I seem to get nothing but errors if Itry to access directly...

"Greg Collins [MVP]" <Greg.Collins_AT_InfoPathDev.com> wrote in message
Yes, you can do all of this. As long as the files are added as Resource
Files in your template, you can access them from your script.js file.

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



Is there any way to add a JavaScript resource and access it from the
standard "script.js" file? (also looking to access other embedded resource
file(s) from the script.js like a configuration xml file).

Thanks in advance,

Tronn
 
T

TDC

Thanks for your reply...unfortunately I just get "Object expected at the
line where I attempt the test...

I imported test.js as a resource, then in OnLoad attempt to call the
function:

if(DoThat()) XDocument.UI.Alert("Whoohoo!");

function DoThat()
{
return true;
}

Thanks again for your response,

T

"Greg Collins [MVP]" <Greg.Collins_AT_InfoPathDev.com> wrote in message
Lets say you add foo.js as a resource file to your template, which has the
following contents:

function fooTest()
{ return true; }

In your script.js file you should be able to do:

if(fooText())
XDocument.UI.Alert("Whoohoo!");

There's nothing special you need to do other than add your .js file as a
resource.

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



Great! Might I have sample syntax?

I seem to get nothing but errors if Itry to access directly...

"Greg Collins [MVP]" <Greg.Collins_AT_InfoPathDev.com> wrote in message
Yes, you can do all of this. As long as the files are added as Resource
Files in your template, you can access them from your script.js file.

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



Is there any way to add a JavaScript resource and access it from the
standard "script.js" file? (also looking to access other embedded resource
file(s) from the script.js like a configuration xml file).

Thanks in advance,

Tronn
 

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