Created
October 19, 2016 14:20
-
-
Save Pan-Maciek/0e1aa99250c0edacc44462a9490310d8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function saveToServer(nazwa) { | |
| $.ajax({ | |
| type: "POST", | |
| url: window.location.href.replace("index.html", "") + "Server.aspx", | |
| data: { | |
| operation: "save", | |
| data: JSON.stringify({ | |
| nazwa: nazwa, | |
| kolor: color, | |
| time: new Date(), | |
| trasa: JSON.stringify((function () { | |
| var temp = [] | |
| for (var i = 0; i < markers.length; i++) { | |
| var m = markers[i] | |
| temp.push({ | |
| cords: m.cords, | |
| name: m.name, | |
| zoom: m.zoom | |
| }) | |
| } | |
| return temp; | |
| })()) | |
| }) | |
| }, | |
| dataType: "text", | |
| success: function (r) { | |
| console.log(r) | |
| }, | |
| error: function (err) { | |
| console.log("error " + err.responseText) | |
| } | |
| }) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void Save() { | |
| using (var sw = new StreamWriter(HttpContext.Current.Server.MapPath("plik.txt"), true, Encoding.UTF8)) { | |
| sw.WriteLine(Request["data"]+","); | |
| } | |
| Response.Write("save ok"); | |
| Response.End(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment