Παίρνει από ένα input box το περιεχόμενο και το εμφανίζει.
Επιλύθηκε απλά δεν θέλει να είναι το input μέσα σε form στο html
Το index.html βάση του template που μου δίνει το ubuntu SDK
- Κώδικας: Επιλογή όλων
<!DOCTYPE html>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<html>
<head>
<meta charset="utf-8" />
<meta name="format-detection" content="telephone=no" />
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />
<link rel="stylesheet" type="text/css" href="css/index.css" />
<!-- Use Ubuntu Cordova -->
<script language="javascript" type="text/javascript" src="file:///usr/share/cordova-ubuntu-2.8/www/cordova-2.8.js"></script>
<!-- Ubuntu UI Style imports - Ambiance theme -->
<link href="/usr/share/ubuntu-html5-theme/0.1/ambiance/css/appTemplate.css" rel="stylesheet" type="text/css" />
<!-- Ubuntu UI javascript imports - Ambiance theme -->
<script src="/usr/share/ubuntu-html5-theme/0.1/ambiance/js/fast-buttons.js"></script>
<script src="/usr/share/ubuntu-html5-theme/0.1/ambiance/js/core.js"></script>
<script src="/usr/share/ubuntu-html5-theme/0.1/ambiance/js/buttons.js"></script>
<script src="/usr/share/ubuntu-html5-theme/0.1/ambiance/js/dialogs.js"></script>
<script src="/usr/share/ubuntu-html5-theme/0.1/ambiance/js/pagestacks.js"></script>
<!-- Application script -->
<script src="./app.js"></script>
<title>Show Button</title>
</head>
<body>
<div data-role="page">
<header data-role="header">
<nav data-role="navbar" class="tabs" >
<div class="tabs-inner">
<ul>
<li class="active" role="tab">
<h1>Show Something</h1>
<form>
<input type="text" id="wikisearch">
<input type="submit" id="submit" onclick="search()" value="Show">
</form>
</li>
</ul>
</div>
</nav>
</header>
<div data-role="content">
<div data-role="pagestack">
<div data-role="page" id="main">
</div>
</div>
</div>
<div data-role="dialog" id="loading">
<section>
<h1>Apache Cordova Loading</h1>
<progress></progress>
</section>
</div>
<div data-role="dialog" id="deviceready">
<section>
<h1>Deviceready event received</h1>
<button data-role="button" id="devicereadyOK" class="success">OK</button>
</section>
</div>
</div>
</body>
</html>
Και το αρχείο app.js:
- Κώδικας: Επιλογή όλων
var content="Default";
/**
*Function that performs the search to wikipedia
*/
function search()
{
content=document.getElementById("wikisearch").value;
document.getElementById("main").innerHTML=content;
}
/**
*Http Function to get stuff via Web
*@param theUrl: The url that we make the http connection
*/
function httpGet(theUrl)
{
var xmlHttp = null;
xmlHttp = new XMLHttpRequest();
xmlHttp.open( "GET", theUrl, false );
xmlHttp.send( null );
return xmlHttp.responseText;
}
Έχετε ιδέα γιατί συμβαίνει αυτό? Και σε Browser που το τρέχω μου συμβαίνει

