From 365107d794d7e31f31b0685d7fdd22ab24afee32 Mon Sep 17 00:00:00 2001 From: Julian Krispel-Samsel Date: Sun, 5 May 2013 06:56:49 +0100 Subject: [PATCH] avoid passing in dom elements to JSON.stringify to prevent errors close #1063 --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index c116679d..3b80fe09 100644 --- a/index.html +++ b/index.html @@ -570,7 +570,7 @@ $("#e8").select2(); $("#e8_get").click(function () { alert("Selected value is: "+$("#e8").select2("val"));}); $("#e8_set").click(function () { $("#e8").select2("val", "CA"); }); $("#e8_cl").click(function() { $("#e8").select2("val", ""); }); -$("#e8_get2").click(function () { alert("Selected data is: "+JSON.stringify($("#e8").select2("data")));}); +$("#e8_get2").click(function () { var data = $("#e8").select2("data"); delete data.element; alert("Selected data is: "+JSON.stringify(data));}); $("#e8_set2").click(function () { $("#e8").select2("data", {id: "CA", text: "California"}); }); $("#e8_open").click(function () { $("#e8").select2("open"); }); $("#e8_close").click(function () { $("#e8").select2("close"); });