A
A
artshelom2019-02-08 08:09:38
JavaScript
artshelom, 2019-02-08 08:09:38

How can I pass an object to a JS script?

How can I pass an object to a script?
I have a JS file, how to pass an object as a parameter:
start(@traingObj);
I get an error:

Uncaught SyntaxError: Unterminated template literal

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
eRKa, 2019-02-08
@artshelom

const traing = @JsonConvert.SerializeObject(traingObj)
start(traing )

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question