Thank you for the quick response.
Just to let you know my scenario.
I am dealing with a site which has two version of theme,
i). desktop version and ii. mobile version
I have managed to switch the theme with the help of ajax on jquery’s window.resize function and overwriting the current document with html ajax response.