From f1ba327d3d8cc61fc7e4d67532fc76124e30171d Mon Sep 17 00:00:00 2001 From: philipp Date: Thu, 14 Nov 2013 21:27:13 +0000 Subject: [PATCH] Change optional parameter usage to support browsers that do not support them yet. git-svn-id: http://www.winterrodeln.org/svn/servermediawiki/mediawiki_extensions/wrmap/trunk@1804 7aebc617-e5e2-0310-91dc-80fb5f6d2477 --- wrmap.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/wrmap.js b/wrmap.js index aeaf86d..2ed6de8 100644 --- a/wrmap.js +++ b/wrmap.js @@ -6,15 +6,17 @@ function init_wrmap(i, jq_map) { var EPSG3857 = new OpenLayers.Projection("EPSG:3857"); // google // tool functions - function createElement(tagName, attributes={}) { + function createElement(tagName, attributes) { var element = $(document.createElement(tagName)); + if (attributes === undefined) return element; for (var attribute in attributes) { element.attr(attribute, attributes[attribute]); } return element; } - function appendElement(parentElement, tagName, attributes={}) { + function appendElement(parentElement, tagName, attributes) { + if (attributes === undefined) attributes = {}; var element = createElement(tagName, attributes); parentElement.append(element); return element; -- 2.30.2