summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorluxagraf <sng@luxagraf.net>2023-07-19 16:07:20 -0500
committerluxagraf <sng@luxagraf.net>2023-07-19 16:07:20 -0500
commitfa6cb45333d3c597893ed3d1809038d3363bdef4 (patch)
tree5ea9ffef6f7be20406a9fc9ff2f2289864b4aed7
parenta768d2e6698aa57813f69ab1bfb39405483bd0e1 (diff)
posts: take 2 on get url params
-rw-r--r--app/posts/templates/posts/note_form.html7
1 files changed, 4 insertions, 3 deletions
diff --git a/app/posts/templates/posts/note_form.html b/app/posts/templates/posts/note_form.html
index 2f3ac15..b9aa78f 100644
--- a/app/posts/templates/posts/note_form.html
+++ b/app/posts/templates/posts/note_form.html
@@ -26,9 +26,10 @@ function GetURLParameter(sParam){
}
}
};
-var title = GetURLParameter('title');
-var description = GetURLParameter('description');
-var url = GetURLParameter('url');
+let params = new URL(document.location).searchParams;
+let title = params.get("title")
+let url = params.get("url")
+let description = params.get("description")
document.getElementById('id_title').value = title;
document.getElementById('id_url').value = url;
document.getElementById('id_body_markdown').value = description;