views:

838

answers:

3

I'm working on a website for iphone using dashcode. But i don't know how to add a new html page to the 'site'. I could use stackLayout but it takes so much time to load the 'index.html' since it has all the stackLayout's views in it.

enlightenment needed :)

A: 

rather than adding a new html page you could split the existing index.html into "pages" with each page in a and then use the javascript to manipulate the visibility of the divs.

so the javascript looks like this

  function hide_me(el) { 
if(document.getElementById(el)) {
    if(document.getElementById(el).style.display != "none") 
    document.getElementById(el).style.display = "none";
}

} function show_me(el) { if(document.getElementById(el)) { if(document.getElementById(el).style.display == "none") document.getElementById(el).style.display = "block"; } }

then in the html

   <ul>
     <li><a href="javascript:
   show_me('one');
   hide_me('two');
   hide_me('three');
        etc......
     </li>
  </ul>

and further down the index.html

        <div class="mainContent" id="one">
        <!-- generated html -->
        <table>
            <tbody>
                <tr class="head">
                    <td class="item" colspan="2">
                        CHMOD
                    </td>
                </tr>
         etc .....
     </table>
     </div>

This way the load is all taken when the widget is fired up and therafter you just display the divs as opposed to having to load them

PurplePilot
A: 

Actually the problem is that there is no way to add a new page to the dashcode. Though the solution you specified works but what if we really want to load a new page. I didnt find any answer on google. So does that mean to create everynew page we have to create a new project each time? Its been just my second day in iPhone web app development and i am still trying to understand why is that the case.

varun
A: 

Click:

FILE > NEW > FILE

Then, rename the file to "whatever.html"
You're welcome!
My site was made with Dashcode!

Griffen