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

How to run code from a HTML function? #539

Closed
SirMangler opened this issue Apr 25, 2019 · 2 comments
Closed

How to run code from a HTML function? #539

SirMangler opened this issue Apr 25, 2019 · 2 comments

Comments

@SirMangler
Copy link

Example HTML: <button onclick="myFunction()">Click me</button>

Javascript seems to do it like so: object.addEventListener("click", myScript);

My main intention is to receive input from a HTML page and execute a method, namely buttons and text input.

@ItsHarper
Copy link

This has nothing to do with NanoHTTPD, and you're better off asking on StackOverflow.

That being said, there's no such thing as an "HTML function". What your example HTML will do is run the JavaScript function defined like so:

function myFunction {
    // do stuff
}

@SirMangler
Copy link
Author

Thanks for your response. After some research I understand now that most websites handle that kind of action through JavaScript (which obviously isn't related to this library), which is triggered through the HTML.

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

2 participants