v1
- by redyetidev 3/26/202400
disable setup HTML
Setup HTML
<div id="output"></div>
disable setup JavaScript
Setup JavaScript
const search = "?foo=value=bar"
// Should output 'value=bar'
delete caserun single casemove downdrag and drop case


ready



function get(name) {
	//KNOX-820 changing the regex so that multiple query params get included with the 'originalUrl'
	if ((name = (new RegExp('[?&]' + encodeURIComponent(name) + '=([^]*)')).exec(search))) {
		return decodeURIComponent(name[1]);
	}
}
delete caserun single casemove updrag and drop case


ready



// Renamed for test
function get(name) {
  return new URLSearchParams(search).get(name);
}
Test Case - click to add another test case
disable teardown JavaScript
teardown JavaScript
document.getElementById("output").innerText = get("foo")
Output (DOM) - click to monitor output (DOM) while test is running
RUN