Skip to content
Advertisement

Tag: path

Reading the parameter values off the current URL on page load

I realize retrieving search params from the URL is a commonly asked Question but I am running into an issue with using URLSearchParams(window.location.search) because I believe it is searching for a ? and my url contains & as separators between values. my url will look something like this http://localhost:8080/monitor/patientName=Courtney+Patient&pageSize=50 My Goal is to pull out the searchParams in the url

Svg animations replaying in the same spot

I am working on a tower defense game with HTML, CSS, and JS. I want to be able to create svg circles that will follow a path using an svg animation. In order to do this, I wrote this code: The first time I run the attackerSvg function, everything works fine. A circle is created at the start of the

d3 line generator returning null rather than path data string

I’m using d3 v4 to create a line graph. My pathGenerator, using d3’s line() method, is returning null instead of a path data string (eg “M 100 100 L 300 100 L 200 300 z”), and therefore no lines are being drawn. When I add in console.log()s to try to determine where the issue occurs, the passed in datum appears

remove last directory in URL

I am trying to remove the last directory part of an URL. My URL looks like this: https://my_ip_address:port/site.php?path=/path/to/my/folder. When clicking on a button, I want to change this to https://my_ip_address:port/site.php?path=/path/to/my. (Remove the last part). I already tried window.location.replace(//[A-Za-z0-9%]+$/, “”), which results in https://my_ip_address:port/undefined. What Regex should I use to do this? Answer Explanation: Explode by “/”, remove the last element

javascript site root

I have this site that I need to find the root folder / plus the actual folder its works out of. My problem here is that during development i have the folder with in my local server that in turn is with in its own folder: Then online I then have the development site within a folder, so it can

Get the first part of a url path

If I have a url like: http://localhost:53830/Organisations/1216/View I want to alert the first part of the url path in lowercase format e.g. ‘organisations’ So far I have: but it’s not working as intended. Can anyone help? Thanks Answer

Advertisement