How do I remove get variables and filename from URL using javascript/jquery?
问题 I was looking into this issue but I couldn't find any solid answers for this specific purpose. Let's say I have a URL of... http://mysite.com/stuff/index.php?search=my+search How can I grab this URL and remove index.php?search=my+search from it so it would just be http://mysite.com/stuff/ ? Basically I just want to grab the parent URL without a filename or get variables... No matter what the URL (so I don't have to customize the function for every page I want to use it on) So for an