Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Desktop: Titanium does not process my code

Hey all, i developed an application with mobile sdk, but now i'm pretty new to desktop api. Below is my index.html code. Titanium doesn't process the scripts both local api and the php code. All I have for the output is the sample application view with an empty screen. It doesn't change the window size nor doesn't display the string "hello mello". (I checked PHP on Titanium App Settings)
Any ideas?

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
    <head>
        <title>
            selams
        </title>
        <script>
        var window = Titanium.UI.currentWindow;
            window.height = 100; // The same.
            window.width = 100;
        </script>
    </head>
    <body style="background-color:#1c1c1c;margin:0;width:100px;height:50px;">
        <div style="border-top:1px solid #404040">
            <div style="color:#fff;;padding:10px">
                <script type="text/php">
                    echo "hello mello";
                </script>
            </div>
        </div>
    </body>
</html>
— asked July 16th 2010 by Ahmet Sulek
  • desktop
  • php
  • problem
  • process
  • script
0 Comments

3 Answers

  • Here i have wrote some test app which shows output "hello world" in native cmd prompt which will be created when u click launch & javascript code will be executed when u press buttton which i have provided in code

    <html>
    <head>
    <title>
    selams
    </title>
    <script type="text/javascript">
    function wind()
    {
    var bounds = Titanium.UI.currentWindow.bounds;
    console.log("Previous bounds: " +
    " x: " + bounds.x +
    " y: " + bounds.y +
    " width: " + bounds.width +
    " height: " + bounds.height);
    bounds.width = 900;
    Titanium.UI.currentWindow.setBounds(bounds);
    }
    function fullscreen()
    {
    Titanium.UI.currentWindow.setFullscreen(!Titanium.UI.currentWindow.isFullscreen());
    }
    </script>

    </head>
    <body>
    <div style="background:#000000">
    <div style="background:#ffffff">
    <script type="text/php">
    echo "hello mello";
    </script>
    Click Here to Change WIDTH : <input type="button" value="Click" onClick="wind()" name="Click" id="but1"/>
    Click Here to SET FULL SCREEN : <input type="button" value="Click" onClick="fullscreen()" name="Click" id="but2"/>
    </div>
    </div>
    </body>
    </html>

    — answered July 16th 2010 by Varun Atluri
    permalink
    2 Comments
    • Your code works perfectly for resizing. At least I have no more doubt on the processing mechanism. Do you have any idea about the php part?

      — commented July 16th 2010 by Ahmet Sulek
    • check it
      http://pastie.org/1042439

      — commented August 11th 2010 by Varun Atluri
  • hi guys,

    This might help check it out

    http://developer.appcelerator.com/question/44681/cant-run-php–on-windows-desktop-app

    http://developer.appcelerator.com/question/43781/desktop-titanium-does-not-process-my-code

    check it http://pastie.org/1042439

    Urs..

    — answered August 19th 2010 by Varun Atluri
    permalink
    1 Comment
    • The second link is a link to this question ?!

      — commented February 17th 2011 by M. S.
  • in my titanium this PHP code not working, so Hello mello does not appear after run

    — answered April 26th 2011 by Greg
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.