JQuery mobile 1.4.5 min js not working with Windows Phone 8.1

JQuery mobile 1.4.5 min js not working with Windows Phone 8.1

Hi,

I'm developing a windows phone 8.1 app using JQuery, WINJS and backbone. 

The app is running fine while debugging, but when the app is packaged for release (.appx). The app crashed.

upon diagnosis we figured out that window.location is becoming null while the app is installed and when Jquery.mobile.1.4.5.js is loaded.

Any idea why is this happening?