Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Referencing issues within JS script #106

Open
rossrossp opened this issue Feb 21, 2017 · 0 comments
Open

Referencing issues within JS script #106

rossrossp opened this issue Feb 21, 2017 · 0 comments

Comments

@rossrossp
Copy link

Not an issue I don't think, but I am having issues when referencing ect outputs inside JS code.

  1. How would I fetch an entire object and assign it to a JavaScript variable?
    var client = "<%= @objects.client %>"; results in client being equal to "[object Object]" instead of:
    { id: 1, name: "Ross" }

  2. How would I initialize a JavaScript variable to an ect value which is an integer?
    var clientId = "<%= @objects.client.id %>"; results in clientId being either '1' or '' when it's not set, instead of 1 or null.

Removing the ""s surrounding the ect code results in the JavaScript not compiling and therefore not running properly.

Many thanks,
Ross.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant