javascript - Dynamically Refreshed Pages produced by Python -
I'm researching it for several months now, but I'm unable to find clear directions.
My goal should be on a page with a form on it and an article on it. The forms can be filled out and then the CGI Python script can be sent (yes, I will be transferred to WSGI or Fastcaggy later, I am starting simple!) I want to be able to send the form multiple times, So the user can update the graph, but I do not want to reload the page every time. I have a form and a graph, but they are on different pages and work as a traditional script.
I would like to avoid all the structures except JQuery (as I like it, I do not like working with quears of different browsers, etc.)
In the right direction, a nook All I'm asking for here, or as specific as you care about.
(I've got similar guides to doing this in PHP, I believe, but for some reason, they did not serve their purpose.)
< Strong> Edit : The graph form is generated using the input from the input and the float processed in Python Script (a JQuery plugin). The Python script prints javascript which finally produces the graph. All this can be done in Javascript, but I want the heavy stuff to be handled server-side, so the Python.
Thank you!
I assume that you currently have two pages - a page that shows the form, and A page that receives POST request and shows the graph.
What little jQuery you can do exactly what you want.
Add your form page to an empty div id = "results"
first. In your graph plotting page, you want to show the next YouTube in the same ID from the same ID.
Now give the submit button to an Oklclick handler (or in individual parts of the form) you want it to be more dynamic). It should serial the form, deposit it on the encrypted page, strip the contents of id = "results"
div and put them in the content on id = "results"
div Form page.
This user will appear on the graph that appears on the page, whenever they click Submit.
Here you have a sketch of the jQuery code that you will need
$ (function () {// submit form // Return the returned html, and Get the contents of #Rusts and put it in #results var submit = function () on this page {$ .Ajax ({type: "post", data: $ ("form"). Serialize (), success ReplaceWith ($ ("# results", $ (data)));}}};}; $ ("form input [type = submit]": (function, data, textstate) {$ ("# result"). Click (Submit) I think that you also need to make sure that the form does not submit submit via browser $ ("form"). (Function () {return false;}}}}; < / Code>
edit
For the above explanation, if you want to redefine the form to the graph, Click not only when users submit the click, then add some more things like this
$ (" Horm input [type = text] "). Kunjeepois (submit); $ ("Form input [type = checkbox], choose form"). Change (Submit)
Comments
Post a Comment