Dynamic JQuery Mobile Navigation

I am having an issue with jQuery and how to dynamically process urls. What I would like to do is this if I have a page with links and each one has an id to call a function and an id parameter. How can I change the url for the specific link and have that url also work as a bookmark. I also need it to be in one file meaning no external files.