javascript - How to run a Python script upon button click using mod_python without changing browser window -
i using mod_python
publisher set , working fine. allows me run python file in browser , python file has html embedded in it. have defined click-able image input type = "image" onclick = "some action"
. when click image takes me javascript function performs window.location = "./move"
takes me python function. problem browser window redirects function, i. e. localhost/scripts
becomes localhost/scripts/move
. possible execute script without having browser window change? can post code if needs be.
in fact, i've found using ajax/xmlhttprequest simple , work that, if server python simpleserver style.
you link javascript code button:
// send request, don't refresh page xhttp = new xmlhttprequest(); xhttp.open("get", "?like", true); xhttp.send();
Comments
Post a Comment