svvvvgggggg

main
joak 1 year ago
parent b9dc75d82b
commit 7120061589

@ -11,8 +11,7 @@ def drawPlz():
name = request.form.get('lostobject') name = request.form.get('lostobject')
msg = "Sorry that you lost {name}. But {name} will be having fun somewhere." msg = "Sorry that you lost {name}. But {name} will be having fun somewhere."
if request.method == 'POST': if request.method == 'POST':
print("is this workhing?") image = request.form["data"]
image=request
print(image) print(image)
return render_template("drawing.html", title=title, msg=msg) return render_template("drawing.html", title=title, msg=msg)
@ -28,7 +27,8 @@ def index():
# Read the values from the form element. # Read the values from the form element.
name = request.form.get('lostobject', 'nana') name = request.form.get('lostobject', 'nana')
text = request.form.get('text', 'haha') text = request.form.get('text', 'haha')
print(text)
# date = request.form['dd-mm-yyyy'] Q.How can I include date? Or maybe general date input? Sometimes ppl do remember when they lose sth. and somethimes they do not know. # date = request.form['dd-mm-yyyy'] Q.How can I include date? Or maybe general date input? Sometimes ppl do remember when they lose sth. and somethimes they do not know.
# Write the submitted data to a file, which is # Write the submitted data to a file, which is
@ -51,4 +51,4 @@ def index():
if __name__ == '__main__': if __name__ == '__main__':
APP.debug = True APP.debug = True
APP.run(port = 5000) APP.run(port = 5000)

@ -97,7 +97,8 @@ var xhr = new XMLHttpRequest();
function sender(){ function sender(){
xhr.open("POST", "/2ndpage", true); xhr.open("POST", "/2ndpage", true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8"); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
someStuff=document.getElementById("svgElement"); someStuff=document.getElementById("svgElement").innerHTML;
xhr.send(someStuff); xhr.send("data="+someStuff);
console.log("I'm sending") console.log(someStuff);
console.log("I'm sending");
} }

Loading…
Cancel
Save