Page 1 of 1

javascript file issues

Posted: Mon Dec 10, 2012 6:53 am
by Slang

Hello

I added a javascript file (refpt.js) to my project but I get "undefined' errors when I try to access any functions in it. When I open it up Chrome's JavaScript console, it shows the entire file's contents on a single line and the error "unexpected end of input". But the code itself has no errors, I tried it out by adding it to the load event of the screen and it works fine.

Can you tell me what I'm doing wrong?


javascript file issues

Posted: Mon Dec 10, 2012 1:40 pm
by Kateryna Grynko

Hello,
There is an issue, it will be fixed in approximately 2 weeks.
As a workaround, you can delete all the comments in code.


javascript file issues

Posted: Mon Dec 10, 2012 4:16 pm
by Slang

I already did. That was the first thing I tried when I saw it was wrapping the entire file's contents to a single line, because comments were basically commenting out the rest of the file from that point on. So I removed every comment, both single as well as multi-line ones, but that doesnt fix it.

Btw, the entire "javascript file" interface is broken:

  1. Cannot upload existing js files. Even after I select th efile and hit upload, it just sits there and doesnt load the contents. Have to cope/paste to get the contents loaded.

  2. If I make "small changes" to the file, it doesnt save those. Even when I delete some characters or add a line, the save button does nothing and if I close the file and come back to it, the changes are gone

  3. I believe long js files dont work. Small ones seem to work but probably after a certain number of characters, it is unable to deal with the file.

    As a workaround, I placed the js code into the event handler for a screen load, but I am a newbie and dont know how to call functions in that code from another handler. Is that something you can help with? For instance, if I have a function called foo() in the js code that gets invoked for a screen load, and then I want to call that function from a button press, how do I do that? Just calling foo() doesnt seem to work.

    Thanks


javascript file issues

Posted: Mon Dec 10, 2012 5:35 pm
by Kateryna Grynko

There is a tab 'External resources' in 'Project settings'. You can add JS code there.
We will solve the problem.


javascript file issues

Posted: Mon Dec 10, 2012 7:47 pm
by Slang

Ok thanks that works. Let us know once the issue is fixed.