0

External Javascript

asked 2011-02-22 04:06:03 +0800

Neus gravatar image Neus
1415 14

Hi all,

I want to exclude from my workspace a javascript file because it will be used from other workspaces.
Until now I was doing this in my page init class:

Script s = new Script();
s.setSrc("/recursos/js/FuncionesComunes.js");

Now I'm trying to set an absolute path to de javascript file in setSrc(). But it seems it doesn't find the file.

How can I include an external javascript file in my project?

Thank you!

delete flag offensive retag edit

3 Replies

Sort by ยป oldest newest

answered 2013-10-14 17:40:39 +0800

Senthilchettyin gravatar image Senthilchettyin flag of India
2623 3 8
http://emrpms.blogspot.in...

Hi I have the same problem

link publish delete flag offensive edit

answered 2011-02-23 03:16:27 +0800

Neus gravatar image Neus
1415 14

I write this at the top of my page and it doesn't work:

<?script src="///D$/StsDocumentosAppWeb/Javascript/FuncionesComunes.js"?>

Otherwise I want to use the script on all my pages, I have to write it in every zul?

link publish delete flag offensive edit

answered 2011-02-22 14:18:19 +0800

twiegand gravatar image twiegand
1807 3

Neus,

If it doesn't have to be dynamic, you could try the script directive at the top of your zul like this:

<?script type="text/javascript" src="/scripts/myScript.js"?>

Or you could try the <script> tag like this:

<script src="/scripts/myScript.js" defer="true"/>

Have a look here for more info...

Just some thoughts...

Regards,

Todd

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2011-02-22 04:06:03 +0800

Seen: 555 times

Last updated: Oct 14 '13

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More