1

I want to update divs by html pages.I have used Ajax.Updater and jquery .load() .These are good.Can anyone suggest someother methods?? I want to show html pages in some div.Thanks in advance.

2
  • Can you clarify : Are Ajax.Updater and jquery.load() not enough for you ? Commented May 2, 2013 at 7:10
  • Yes,but I want to know other options too. Commented May 2, 2013 at 7:11

4 Answers 4

3

For me the best way to dynamically generated content is via Jquery. For your problem, so I think the following code:

 $(document).ready(function() { 
    $('#ContentPage').load('MyPage.html');
}
Sign up to request clarification or add additional context in comments.

1 Comment

Yes,But it will load from cache.SO changes wont be easily available
1

jQuerys .load() is the best option as far as im concerned.

Reference

Comments

1

Ajax.Updater and jquery .load() are best.

If you are curious you can try

   $.ajax({
    url: 'page.html',
    dataType: 'html',
    timeout: 5000, // 5 seconds
    success: function(html) {
    $("#myDiv").html(html);
    }
    });

Comments

1

I recommend you always using $.ajax function over $.load for that purposes. The reason is that $.load is using cache, which cannot be disabled with parameters while defining it - the only way to disable caching for $.load is to disable it globally for all ajax calls.

After all, $.load is just a wrapper for $.ajax

Globally disable cache

load vs ajax

I am not sure about ajax updater vs ajax, will check and update answer...

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.