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>
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> -
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..
-
in my titanium this PHP code not working, so Hello mello does not appear after run