Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Javascript file issue
Baku
Hello all,<br />
<br />
Not sure how to explain that..<br />
I have an external js file, correctly attached as a resource, for example 'testlib.js'<br />
But it looks like this js file is only accessible at the server side. To explain :<br />
<br />
Here is a function in this file :<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
function testExternalFunction(number){
return 2*number;
}
</pre>
<br />
But when from my report I call this function, I get an error : 'number is undefined'<br />
The variable 'number' that I try to pass as argument is calculated at the client side (come from javascript operation on some dates), here seems to be the problem. <br />
<br />
Is it possible to have js file accessible at client side ??<br />
<br />
Thx
Find more posts tagged with
Comments
mwilliams
Can you recreate your issue in a report I can run and attach your simple js file and rptdesign file in here? Thanks!
Baku
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="82395" data-time="1315423308" data-date="07 September 2011 - 12:21 PM"><p>
Can you recreate your issue in a report I can run and attach your simple js file and rptdesign file in here? Thanks!<br /></p></blockquote>
<br />
I don't even have to do this, I'am sure it's impossible by this way. I you want to test you can add a js ressource to a new report with a basic function like :<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
function someCalculation(number){
return 2*number;
}
</pre>
<br />
and try to call the function with something like :<br />
<br />
<script><br />
var myNumber = 5;<br />
var result = someCalculation(myNumber);<br />
alert(result);<br />
</script><br />
<br />
I saw this post on another forum:<br />
<br />
<a class='bbc_url' href='
http://www.lebirtexpert.com/wordpress/2010/08/03/javascript-functions-lib/'>http://www.lebirtexpert.com/wordpress/2010/08/03/javascript-functions-lib/</a><br
/>
<br />
Look at the Admin's comment (December 15, 2010 at 6:51 pm), he has a good explanation.<br />
<br />
Thx
mwilliams
Yeah, if I'm calling script on the client side, I always define the function in a text box like in the admin comments. I hadn't tried the other way, so I just wanted to see how you had it set up. Hopefully you've got things working now!
Baku
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="82580" data-time="1315849347" data-date="12 September 2011 - 10:42 AM"><p>
Yeah, if I'm calling script on the client side, I always define the function in a text box like in the admin comments. I hadn't tried the other way, so I just wanted to see how you had it set up. Hopefully you've got things working now!
<br /></p></blockquote>
<br />
Thx mwilliams, indeed I put all my script in a text box and that's it, I didn't try the other way either.