What is the way to replace HTML using jquery without loading original HTML?
-
I am loading HTML content from the third party server using JSONP & using jQuery.html("html") function to replace full HTML. I have used this code in head tag but when I am trying to access that site, it loads the default HTML first & then replace the HTML using jQuery. Is there any way to make the jQuery loaded HTML to be displayed first? Any help would be appreciated. Thanks.
-
Answer:
You could wrap your original content in one hidden div (display: none; in CSS), and dump your loaded content into another one which is visible. Then you can show/hide/toggle either divs easily using jQuery. BTW since your remote content may take a while to load, it's good to have a loading indicator at page load, too.
Tuan-Anh Fan at Quora Visit the source
Related Q & A:
- How to Search using jQuery ASP.Net?Best solution by Stack Overflow
- How to create your own slider using jQuery?Best solution by Stack Overflow
- how to set value in ckeditor using jquery?Best solution by Stack Overflow
- how to submit form using jquery mobile?Best solution by Stack Overflow
- How can I find and replace html links with Notepad++?Best solution by stackoverflow.com
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.