Skip to content

Commit c7da06b

Browse files
committed
Fix mysterious hardcoded genome in manual primer entry
Parse querystring natively
1 parent 7505d24 commit c7da06b

File tree

1 file changed

+5
-14
lines changed

1 file changed

+5
-14
lines changed

src/primer-design/web/js/manualPrimerEntry.js

+5-14
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
var geneName = getUrlVars()['gene'];
2-
var ENSID = getUrlVars()['ensid'];
3-
var GENOME = getUrlVars()['org'];
1+
var params = new URLSearchParams(location.search);
2+
var geneName = params.get('gene');
3+
var ENSID = params.get('ensid');
4+
var GENOME = params.get('org');
45
var RELEASE = function (){
5-
//TODO: get the genome here! (hardcoding for mm10 atm)
66
var tempRelease = null;
77
$.ajax({
88
'type' : "POST",
99
'dataType' : "html",
10-
'data' : {genome: 'mm10'},
10+
'data' : { genome: GENOME },
1111
'async' : false,
1212
'url' : "./ajaxCalls/fetchRelease.py",
1313
success : function (html) {
@@ -19,15 +19,6 @@ var RELEASE = function (){
1919

2020
document.title = geneName + " Manual Primer Entry";
2121

22-
// thank you anonymous author at html-online.com/articles/get-url-parameters-javascript/
23-
function getUrlVars() {
24-
var vars = {};
25-
var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) {
26-
vars[key] = value;
27-
});
28-
return vars;
29-
}
30-
3122
function populateOnLoad(){
3223
$('#page-title').html("Manually Enter Primer Pair for " + geneName);
3324
}

0 commit comments

Comments
 (0)