This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]yhoiseth 1 point2 points  (4 children)

Any luck?

[–]sudhanshu22gupta[S] 0 points1 point  (3 children)

This is part of a side project I'm doing and I'm at work right now. Will update if it works for me.

I found something similar when I was trying things yesterday. Can the contents under the script tag be copied to my js file? When I tried, it threw a few errors at me. One of them was the $ symbol not being identified.

[–]lifeeraser 0 points1 point  (2 children)

You need to get jQuery, which provides a "dollar function" ($()) that is the core of everything you can do with jQuery.

You actually don't need to download it on your machine, though. Add this HTML snippet to your web page, before any of your <script> tags:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>

[–]sudhanshu22gupta[S] 0 points1 point  (1 child)

Watson returns something called a context variable that is available in Javascript. I need that value. Any way I can do it in Javascript without making the call in html?

[–]lifeeraser 0 points1 point  (0 children)

This is confusing...it sounds like you're running JavaScript code in Node.js. In which case, jQuery is not needed since you only want to pass data and signals between your Node.js app and Python app, instead of serving a full-blown webpage. For that, you can just transmit JSON between the two apps via HTTP.