-
1. Re: Including JS file
ilya_shaikovsky Jun 1, 2009 6:17 AM (in response to shivaji.byrapaneni)include the JS via loadScript in the next way:
<a4j:loadScript src="/JS/NominationScripts.js">
It will generate the full path including context path. Currently you have problems with relative path. -
2. Re: Including JS file
shivaji.byrapaneni Jun 1, 2009 6:32 AM (in response to shivaji.byrapaneni)i i ncluded teh same in the form and got this on client side
<script src="/NominationWeb/JS/NominationScripts.js" type="text/javascript">
still teh same problem exists.
this is in my js filefunction tester(){ alert("Hi.."); }
nothing more than this
pls help -
3. Re: Including JS file
ilya_shaikovsky Jun 1, 2009 6:41 AM (in response to shivaji.byrapaneni)"ilya_shaikovsky" wrote:
include the JS via loadScript in the next way:<a4j:loadScript src="/JS/NominationScripts.js">
<b>It will generate the full path including context path.</b> Currently you have problems with relative path.
if you want to use src it should be related according to context path like<script src="/JS/NominationScripts.js" type="text/javascript">
-
4. Re: Including JS file
shivaji.byrapaneni Jun 1, 2009 6:50 AM (in response to shivaji.byrapaneni)including the thing you said had solved me the page load script problem
but i tried calling method in my js like this<h:inputText value="#{registerBean.userId}" id="userIdit" onkeyup="tester()">
it is throwing me with javascript erro again saying object expeted
thanks in advance -
5. Re: Including JS file
ilya_shaikovsky Jun 1, 2009 7:01 AM (in response to shivaji.byrapaneni)and this is a problem in your JS for sure. works fine for us.. we using the same approach at demosite. You could visit and check. (component control zoom sample.)
-
6. Re: Including JS file
shivaji.byrapaneni Jun 1, 2009 7:33 AM (in response to shivaji.byrapaneni)i tried calling some java script in build functions in teh placve of my function
they were working only the included scripts functions were not working.
i had cross cheked twice in my js file for any issues
i cant find any ...
here is my js file contentsfunction testme(){ alert("Hi...!!"); }
nothing more than this.. -
7. Re: Including JS file
shivaji.byrapaneni Jun 1, 2009 7:36 AM (in response to shivaji.byrapaneni)if i paste the contents like this in my page it working fine
<script type="text/javascript"> function testme(){ alert("Hi...!!"); } </script>
only its not picking up from JS file -
8. Re: Including JS file
nbelaevski Jun 1, 2009 7:43 AM (in response to shivaji.byrapaneni)Check if there are any errors loading scripts with Firebug tool (use "Net" tab).