From 6552c1e3b9bacbe1a9b52ba4cd7dcfe70e77aef6 Mon Sep 17 00:00:00 2001 From: Juan Carlos Ponce Campuzano <37394697+jcponce@users.noreply.github.com> Date: Mon, 26 Feb 2024 14:33:49 +1000 Subject: [PATCH] Update main.js --- 3d-plotter/main.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/3d-plotter/main.js b/3d-plotter/main.js index afe1796..cb1ccd2 100644 --- a/3d-plotter/main.js +++ b/3d-plotter/main.js @@ -583,11 +583,22 @@ function animate() { requestAnimationFrame(animate); }; +/* function readURLParms() { var hash = decodeURIComponent(location.hash.substring(1)); //"substr" is deprecated if (hash.length > 1) $("#equations").val(hash); } +*/ +function readURLParms() { + location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m, key, value) { + value = decodeURIComponent(value); + if (key == "equation") { + graph.currEquation = value; + $("#equations").val(value); + } + }); +} $(window).resize(onResize);