Notice: The Monaca & Onsen UI Community Forum is shutting down.

For Onsen UI bug reports, feature requests and questions, please use the Onsen UI GitHub issues page. For help with Monaca, please contact Monaca Support Team.

Thank you to all our community for your contributions to the forum. We look forward to hearing from you in the new communication channels.

ons-splitter: calling a link instead of local html file

  • Hi,

    I have an ons-splitter page. Loading the menu with fn.load function.
    It works fine for the local html file.

    But If I call an link, I get the below error.

    onsenui.min.js:2 Uncaught (in promise) Error: "html" must be one wrapper element.
        at Object.util.createElement (onsenui.min.js:2)
        at onsenui.min.js:4
        at <anonymous>

    my code:


        window.fn = {}; = function() {
          var menu = document.getElementById('menu');
        window.fn.load = function(page) {
          var content = document.getElementById('content');
          var menu = document.getElementById('menu');


        <ons-splitter-side id="menu" side="left" width="220px" collapse swipeable>
              <ons-list-item onclick="fn.load('showit.html')" tappable>
                Search Customer
              <ons-list-item onclick="fn.load('/xyz/abc.php?user=Y')" tappable>
                Add New Customer

    Thanks for your help!

  • @mmike Instead of calling fn.load, you need to do: window.location.href = '/xyz/abc/php?user=Y';

  • Ok. Thanks !