0

I have one string in my JSON. the value is To be Reviewed.

I am retrieving this string in my client side using data[i].status syntax. It fetches the correct value but when I send this syntax as paramter it gives unterminated string literal error on client side.

My code is:

onClick=test('"+data[i].product+"','"+data[i].status+"').

How can I send the string value in another function?

thanks in advance.

0

1 Answer 1

2

As you are appending variables you do not need the quotes around them, only the value you are assigning to the onClick parameter. Assuming your test function accepts two parameters, this should work:

onClick="test(data[i].product, data[i].status)"
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.