In my Angular application I have updated some URLs in my project from previously using query string elements like this: http://www.whatever.com/products?productName=TheMainProduct&id=234234 to a route based system similar to this: http://www.whatever.com/products/TheMainProduct/234234 This works fine but most of the time except when there’s a product called something like The / Next / Big Thing So the slashes break the routing as is
Tag: url-routing
Can I create routes with react-router for a github-pages site?
Ok, so I’ve made a SPA using React and React-Router and have pushed it to github pages, but none of the routes I have written work when I refresh or click back in my browser. I had the same problem when I was serving the page locally, but then followed along to this SO answer and made a server.js file
Appending form input value to action url as path
I have a form like this: If I type a value, let’s say: ‘hello’ in the text input field and submit the form, the URL looks like: http://localhost/test/?keywords=hello. I want the value to get appended to the action path. So basically, after the form submission the URL should look like: Answer You can use onsubmit attribute and set the action
RegEx to match stuff between parentheses
I’m having a tough time getting this to work. I have a string like: And I need regex or a method of getting each match between the parentheses and return an array of matches like: The regex I’m using is /((.+))/ which does seem to match the right thing if there is only one set of parenthesis. How can I