From f9aa040505c5c679bed4181e462fb4d2b9216fa6 Mon Sep 17 00:00:00 2001 From: Alan Alpert Date: Fri, 27 Nov 2009 10:40:08 +0100 Subject: Fix use of XmlHttpRequest in examples --- demos/declarative/samegame/content/samegame.js | 1 + demos/declarative/twitter/content/HomeTitleBar.qml | 1 + examples/declarative/tutorials/samegame/samegame4/content/samegame.js | 1 + 3 files changed, 3 insertions(+) diff --git a/demos/declarative/samegame/content/samegame.js b/demos/declarative/samegame/content/samegame.js index 3598c26..8651c84 100755 --- a/demos/declarative/samegame/content/samegame.js +++ b/demos/declarative/samegame/content/samegame.js @@ -235,6 +235,7 @@ function sendHighScore(name) { var postData = "name="+name+"&score="+gameCanvas.score +"&gridSize="+maxX+"x"+maxY +"&time="+Math.floor(timer/1000); postman.open("POST", scoresURL, true); + postman.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); postman.onreadystatechange = function() { if (postman.readyState == postman.DONE) { dialog.show("Your score has been uploaded."); diff --git a/demos/declarative/twitter/content/HomeTitleBar.qml b/demos/declarative/twitter/content/HomeTitleBar.qml index e5bdb85..c48befd 100644 --- a/demos/declarative/twitter/content/HomeTitleBar.qml +++ b/demos/declarative/twitter/content/HomeTitleBar.qml @@ -24,6 +24,7 @@ Item { titleBar.update(); } } + postman.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); postman.send(postData); editor.text = "" diff --git a/examples/declarative/tutorials/samegame/samegame4/content/samegame.js b/examples/declarative/tutorials/samegame/samegame4/content/samegame.js index b833385..2a0d718 100755 --- a/examples/declarative/tutorials/samegame/samegame4/content/samegame.js +++ b/examples/declarative/tutorials/samegame/samegame4/content/samegame.js @@ -238,6 +238,7 @@ function sendHighScore(name) { var postData = "name="+name+"&score="+gameCanvas.score +"&gridSize="+maxX+"x"+maxY +"&time="+Math.floor(timer/1000); postman.open("POST", scoresURL, true); + postman.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); postman.onreadystatechange = function() { if (postman.readyState == postman.DONE) { dialog.show("Your score has been uploaded."); -- cgit v0.12