Problem description
iOS: window.history.back() is not working on webViews
Steps to reproduce
Open a webView including a link to another html page.
In the new page, trigger the 'window.history.back()' function.
Result: page is not going back to the previous one
It works fine on Android.
Sample code:
// app.js
var win = Titanium.UI.createWindow({
backgroundColor : 'blue',
title:'Test'
});
var wv = Ti.UI.createWebView({
url:'index.html'
});
win.add(wv);
win.open();
// index.html
<!DOCTYPE html>
<html>
<head>
<title>Test</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<a href="page1.html">page1</a>
</body>
</html>
// page1.html
<!DOCTYPE html>
<html>
<head>
<title>Test</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<script>
function goBack() {
window.history.back();
}
</script>
</head>
<body>
<input type="button" onclick="goBack()" value="Back"/>
</body>
</html>
Kate McGregor