• Post Reply Bookmark Topic Watch Topic
  • New Topic

Connecting javascript to python

 
Vani Sweety
Ranch Hand
Posts: 93
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello
i have two piece of code
one i have used python to write some function
now i want to display this function on a html webpage
how can i connect python function using javascript on even click
help please
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65666
129
IntelliJ IDE Java jQuery Mac Mac OS X
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I do not believe that you can. The python runs on the server, correct? JavaScript runs on the client.
 
Vani Sweety
Ranch Hand
Posts: 93
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes
is there any way i can connect python function so that it display on my html page
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65666
129
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
With JavaScript? You'd need to make an Ajax request.
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 36027
432
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is your python running on a server like in LAMP? Or just a standalone program?
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!