Software Archive
Read-only legacy content
17061 Discussions

How to create multiple html and open page from each other through action of button

Arthur_T_
New Contributor I
373 Views

I'm newbie on XDK, I search on internet about this topic and reply say right click on WWW will allow me to create new html file. First, I don't see there is WWW directory listed in DEVELOP tab for me to right click on. Second, even after I created a new html file, how can I instruct other screen open it as I can't see mainpage of new html exists for me to select in button's trigger action (inside another html)?

P.S.

I work on a Standard HTML5 project in XDK ver 3088 and create the new html file through Develop tab->Code->File->New

0 Kudos
6 Replies
Arthur_T_
New Contributor I
373 Views

Basically, using multiple html just aims to better organize the pages into corresponding html and no need all pages go to a single index.html.

0 Kudos
Arthur_T_
New Contributor I
373 Views

Found out how to see the WWW, it will show up on left under DEVELOP tab after close the WEB SERVICES palette. So, only my second question left.

0 Kudos
Chris_P_Intel
Employee
373 Views

A hyperlink is what you want.

<a href="second.html">Click Me To Go to Second Page</a>

If you are using the Design View, then some of the various interactive elements (depending upon the framework) may have an href property.  Just put your file into that property.  For other frameworks you might have to use Javascript;

$(document).on("click", ".uib_w_5", function(evt) {
    document.location = "second.html";
});

 

0 Kudos
Arthur_T_
New Contributor I
373 Views

Thanks, tried your js ok.

FYI: I'm using Framework7 and there is no second.html listed for me to choose for interactive element (button) in Design View. So I need to choose Custom Script and enter your code.

Your code assume open mainpage in the second html, what if need to open another page in second html?

 

0 Kudos
Hamilton_Tenório_da_
Valued Contributor I
373 Views

@Arthur> if you are using Framework7 with subpages, you can use activate_subpage("#pageName");

 

 

 

 

0 Kudos
Arthur_T_
New Contributor I
373 Views

Thanks, I know that way. But what if open a subpage in another html as it is not work if I using document.location = "second.html#subpagename";

Besides, is it a proper way to do the 'Back' on header for back to previous page by this javascript? I'm using UI framework: Framework7 with app designer:

$(document).on("click", ".uib_w_1", function(evt)
    {
        history.go(-1);
    });

where it is script for click on the button "Back" on the header of a page in second html. But that will not has any page changing animation.

0 Kudos
Reply