Dart equivalent of Pjax

Issue

Pjax loads an html page via ajax into a div, see
http://pjax.herokuapp.com/
and
https://github.com/defunkt/jquery-pjax/tree/heroku

What would be the equivalent mechanism in pure dart to load html into a div from a file that would work for all modern browsers? (doesn’t matter if it’s via GET, POST, AJAX, etc)

Solution

This works for me:

  HttpRequest.getString('page.html').then((html){
    querySelector("#content").children.clear();
    querySelector('#content').appendHtml(html);
  });

Answered By – Jan Vladimir Mostert

Answer Checked By – Marie Seifert (FlutterFixes Admin)

Leave a Reply

Your email address will not be published. Required fields are marked *