I have limited JS experience, and I need to split a string that would look something like:
Into http://example.com/ and !/about
I can't unfortuently use PHP and parsing the URL won't work. Right??
This is what I have at the moment:
<script type="text/JavaScript">
var newUrl = window.location.pathname;
var hash=newUrl.split('#');
var f=hash[1];
</script>
I could do this for the 3rd line:
var hash=newUrl.split('com');
And then account for the hash, but the problem with that is if someone goes to
example.com/index.php/#!/about
So I'd then have to double my code after this point.
Any ideas how to split the URL into two parts centring around the hash without having to use what I just mentioned??