url question mark (javascript sample, how to do it) [duplicate] - javascript

This question already has answers here:
How can I get query string values in JavaScript?
(73 answers)
Closed 8 years ago.
Sorry but English is not my mother language. I need a sample on how to make something like this:
I have category and URL is like:
/category
and I want to parse url in javascript to be like this
/category?group=myFirstGroup
I don't know how to express myself, I hope you will understand me. Another example would be like this:
There is a website e.g. www.abc.com with /help section with frequently asked questions for doctors and patients.
I want to give url to people with just questions for doctors or patients, not all questions in one place. Example:
www.abc.com/help?type=doctors (contain just questions for doctors)
www.abc.com/help?type=patients (contain just questions for patients)

I don't think this is a JavaScript specific question. If I understand you right you are talking about query parameters in the context of RESTful Web Services. Is this what you are looking for?

Related

Search query in url [duplicate]

This question already has answers here:
Reference: mod_rewrite, URL rewriting and "pretty links" explained
(5 answers)
How can I get parameters from a URL string?
(12 answers)
Closed 4 years ago.
I'm currently working on a project almost like steamrep.com but for another game and more features.
I know basic php js etc but there is 1 thing i can't seem to understand.
And that is when you for ex search for
yourdomain.com/profiles/ (any id / username)
I can't seem to figure out how to make it so it takes the givin id / username puts it as a variable and display it on a page.
If anyone could give me a lead that would be verry much appreciated!
EDIT: To clear up the question. I want to take the id or username from the url and display it the page as a variable.

Identify a user with js/php, without login [duplicate]

This question already has answers here:
Create unique Poll/vote/survey in php
(3 answers)
how to identify remote machine uniquely in php?
(7 answers)
Closed 6 years ago.
We have a small web-poll system we use in a math class before semester begin on voluntary base. On one hand we dont want the students have to register or download something, because of possible lost of poll participants. On the orher hand there are some students who manipulate the poll by sending lot's of junk answers.
Is there a way to identify a user machine over http? Ideas how to create an simple identification?
Simple: it is not possible to get the users computer name with Javascript. You can get all details about the browser and network. But not more than that.
If you are looking for a simple solution just use a cookie with a far future expire marking the device as already voted. However, this is just a simple solution and does not protect you against users with minimal IT skills. You could consolidate the separation by saving a hashed value of their Browser version/os/ip with each vote and you can filter results when counting

How to check if string contain the "url or link" and retrieve it [duplicate]

This question already has an answer here:
Match all URLs in string and return in array in JavaScript
(1 answer)
Closed 8 years ago.
I have comment section of page where user can post the comments on uploaded content, I want to check if user has shared any url links in his comment.
for Example -
var comment = "To search more on this question you can look to http://stackoverflow.com/ "
Now How do I find out that it is URL link and retrieve that link?I would be great if I can find a way to do this in Jquery and Java Script but PHP is also acceptable.
Thanks in advance.
Try to use this REGEX
((http:\/\/|https:\/\/)?(www.)?(([a-zA-Z0-9-]){2,}\.){1,4}([a-zA-Z]){2,6}(\/([a-zA-Z-_\/\.0-9#:?=&;,]*)?)?)

Why do many sites using "#!/" for AJAX? [duplicate]

This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
What's the shebang/hashbang (#!) in Facebook and new Twitter URLs for?
Many Ajax sites use #!/ in their URLs. Examples include Twitter (https://twitter.com/#!/Linksku) and Grooveshark (http://grooveshark.com/#!/).
Why do they use the exclamation mark?
https://stackoverflow.com/a/4175129/1232478 links to two Google items that explain it pretty well. In short, it helps make AJAX sites crawlable.
http://googlewebmastercentral.blogspot.com/2009/10/proposal-for-making-ajax-crawlable.html
is ultimately the link.

Facebook tag (fb:...) [duplicate]

This question already has an answer here:
Closed 11 years ago.
Possible Duplicate:
Create similar to fb:tag
In addition to my question:
Create similar to fb:tag
I would like to ask if someone knows how did Facebook create fb:tags using xmlns.
Just technologies and some short explanation.
I might find the answers that I am looking for the other question as well!
xmlns is used just to make html valid xhtml, the functionality wont work just by adding fb:.. imported javascript is the on which process these tags

Categories

Resources