# If window location contains text/parameter

**URL:** <https://forum.kirupa.com/t/if-window-location-contains-text-parameter/270034>\
**Category:** Uncategorized\
**Created:** [September 4, 2008, 2:32pm UTC](https://forum.kirupa.com/t/if-window-location-contains-text-parameter/270034 "2008-09-04T14:32:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Patch](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/patch/32/1095_2.png) [@Patch](https://forum.kirupa.com/u/Patch)\
**Post date:** [September 4, 2008, 2:32pm UTC](https://forum.kirupa.com/t/if-window-location-contains-text-parameter/270034/1 "2008-09-04T14:32:35Z")

</div>

hi guys,

I’m working on a script where I need to get some information from the url…I’ve used ‘location.href’ etc…but i’m not getting anywhere at the moment (does it matter if the js file is external?).

But anyway, basically I need to extract the **#info** from my url i.e. [www.example.com/](http://www.example.com/) **#info**. and if (location.href contains == #info) { function1(); } etc…

sorry I bet sounds really confusing…But if you can help in anyway that would be great.

cheers
