Detect parent window URL from iFrame?

Hello, I am trying to find out how I can detect the current url of the parent window from an iframe. I would like to have a statement that does something if the parent window URL is “/story.php?title=anyparameter”, so as long as url is story.php regardless of any parameters that follows it would execute another function.

Any help on this would be greatly appreciated!

function checkPage() {
    var requestedFilename = window.parent.location.href.split(document.domain)[1].split('?')[0];