Exemple #1
0
                Content page 2
                <br>
                <a href="" onclick="TouchyJS.Nav.back(); return false;">Go back</a>
                
                <br><br><br><br><br><br><br>
            </div>
        </div>
        
        <script>
            if(!isTouch) {
                document.write('<script src="js/libs/jquery-1.6.2.min.js"><\/script>');
            } else {
                document.write('<script src="js/libs/zepto.min.js"><\/script>');
            }
        </script>        
        <script src="js/libs/touchy.min.js"></script>       

        <!-- TouchyPHP:getFile lets you reduce http requests: http://labs.doat.com/touchyphp/#getFile -->
        <?php 
echo TouchyPHP::getFile('js/script.js', FALSE);
?>

        <!-- Change UA-XXXXX-X to be your site's ID -->
        <script>
            window._gaq = [['_setAccount', 'UAXXXXXXXX1'], ['_trackPageview'], ['_trackPageLoadTime']];
            document.write('<script src="' + ('https:' == location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js"><\/script>');

        </script>
    </body>
</html>
Exemple #2
0
            
            Notice that backround-image url paths will be adapted to the php page location
        -->        
        <?php 
echo TouchyPHP::getFile("css/style.css", TRUE);
?>
    </head>
    <body>
        <!-- This element's background image is specified in style.css. If you see the image - all works OK -->
        <div class="image"></div>
        <br>
        <!--
           Example #3: embedding an image
           @param <string> file path relative to php page. path must be relative.
           param <boolean> (optional) Default is TRUE, the image data will be embeded as data uri (base64 encoding) 
                Sending FALSE will return the original file path supplied
                
           Use judgement when embedding images for they might be larger in size then by a simple http request
        -->
        <img src="<?php 
echo TouchyPHP::getFile("img/image.png", TRUE);
?>
" alt="image" />
        <br>
        <img src="<?php 
echo TouchyPHP::getFile("img/image.png?v=2", FALSE);
?>
" alt="image" />
    </body>
</html>