2

I'm developing a web-based JQuery Mobile application with ASP.NET MVC 4, and I want to make it available as a smartphone application via PhoneGap.

But, JQuery Mobile and other plugins are heavy and I shouldn't download them every time user loads the page.

I want to load CSS styles, JQuery Mobile and other libraries locally.

My idea is: putting an iframe in local html file of app, load remote web pages without scripts and styles, and then, inject CSS styles and Javascript libraries into that iframe.

What do you think? Do you have any better idea? if true, What is your idea? And if false, How to inject JQuery, JQuery mobile and other plugins into that iframe???

3
  • check this question for mobile css injecting: stackoverflow.com/questions/6459692/… Jul 18, 2012 at 10:57
  • @barlasapaydin I think you didn't understand my question. My question is not about loading different css and js files for different platforms. My question is about loading css and js files locally. Jul 18, 2012 at 10:59
  • As long as I remember, getting the .load event of iframe was a challenge for me once. I would suggest that at the bottom of your html, write a script with vanilla js to include css and js files. Remember if you are adding multiple js files, you cannot just create DOM script tags and append them to head in sequence. You will have to load a script and wait for its load event to add another script. Something like aamirafridi.com/jquery/… Nov 20, 2013 at 14:56

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.