3

I am making an app in which I get text from my server and display it in UIWebview. After some time more text is added and client(iphone) is notified about the additional-text. Now I want to inject this text into my UIWebview.

One method is to update some text file and reload the content. But I dont want to reload the page.

Another way can be to use javascript to check updates in a local file (which seems better).

Is there any known better solution?

2 Answers 2

1

If you are getting the data from the server, why not just use JavaScript and preform an AJAX request to update the page?

This allows you to skip the middle man of updating the 'template' file. Just load all of your data with AJAX in order to always have the most 'up-to date' data on the page.

$.ajax({
  url: 'ajax/test.html',
  success: function(data) {
    $('.result').html(data);
    alert('Load was performed.');
  }
});
Sign up to request clarification or add additional context in comments.

1 Comment

this data is based on twitter and facebook authentication which I get from native iphone APIs. So I have to use these authentications to get the data from twitter and facebook.. and plus some of my custom data
1

I believe javascript is better if you want to keep all user edited data (if there is some). And also should be faster than reloading all page.

Comments

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.