URL parameter looking like directory

时间:2015-05-12 22:44:59

标签: javascript url parameters

I have seen websites with site IDs in the URL looking like a folder.

For example: //my third module console.log(files.files) . The page is always the same and gets its content-ID from the URL without the typical GET parameters (www.example.com/detail.html/42). How can i manage this with Javascript?

2 个答案:

答案 0 :(得分:2)

You can use javascript frameworks e.g. AngularJS or if you want only the routing you can use something like sammy.js or do it server-side

答案 1 :(得分:0)

You can't. It's done server-side using URL rewriting.

https://www.addedbytes.com/articles/for-beginners/url-rewriting-for-beginners/

There are different ways of doing this depending on your technology stack (server-side).

If you're building a Single Page App these use something called hashbangs, but they aren't formatted like that.