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

Popular posts from this blog

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

html - Outlook 2010 Anchor (url/address/link) -

android - How to create dynamically Fragment pager adapter -