Topic
  • 3 replies
  • Latest Post - ‏2012-05-18T07:33:31Z by SystemAdmin
SystemAdmin
SystemAdmin
570 Posts

Pinned topic [Solved] Loading new HTML page issues

‏2012-05-16T12:19:53Z |
Hey,

I'm having some problems moving from page to page. My root html file is loaded when I deploy my application as expected. This file is in the common folder. I then try to access a HTML file inside my pages directory and I get unusual results.

I originally setup my js to simply do window.location='pages/login.html'; - this loads a blank page, however if I view the source, it's loaded the page I want, there's just nothing there.

I also tried the recommended way:

WL.Page.load("pages/login.html", {
onComplete: function(){ PAGE2NS.init(); },
onUnload: function() { PAGE2NS.unload(); }
});

When I click simply nothing happens. I'm not sure which way is the best to do this as neither seems to work. Any help would be great!
  • SystemAdmin
    SystemAdmin
    570 Posts

    Re: [Solved] Loading new HTML page issues

    ‏2012-05-16T12:32:11Z  
    Furthermore, if I do the simply window.location and open a standard HTML file, it works no problem. If I try to open a HTML file which is of the same format as the root HTML file that Worklight creates for me (i.e. with all the meta and link information already setup) the same page shows blank. What is it about the tags setup by Worklight that would prevent this?

    I can only assume it therefore requires use of the WL.Page.load function, but that doesn't work for me at current.
  • IdanAdar
    IdanAdar
    288 Posts

    Re: [Solved] Loading new HTML page issues

    ‏2012-05-18T07:03:26Z  
    As mentioned in a previous thread, you cannot work with it by just loading a page, as you will lose your context and things will simply not work; that's how it is in mobile development.

    You have two choices, use jQuery mobile (and follow the documentation they provide), or the Pages and Fragments we provide.

    I think you should first review our training module for this feature as well as sample app to see who to use the API. Have you done this yet?
  • SystemAdmin
    SystemAdmin
    570 Posts

    Re: [Solved] Loading new HTML page issues

    ‏2012-05-18T07:33:31Z  
    Cheers Idan, I've sorted this out now, thanks for your assistance.