In effect, you want to get the partial url information from the server, and only this partial info.
My screensaver is foo.html but the current web page does not know it and needs to retrieve it.
Where on the server can you get this info? Is there somewhere you can ask for /screensaver.php?user=123
and you receive: { "screensaver": "foo.html" } ?
If yes, you may look into $.ajax () or $.getJSON ();