Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-5586] MobileWeb: Methods canGoBack and canGoForward return true if history of webView object is empty

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionWon't Fix
Resolution Date2011-06-10T06:07:12.000+0000
Affected Version/sn/a
Fix Version/sn/a
Componentsn/a
Labelsn/a
ReporterMisha Vasko
AssigneeMaxim Negadaylov
Created2011-06-09T07:46:57.000+0000
Updated2017-03-10T18:53:39.000+0000

Description

Methods canGoBack and canGoForward return true if history of webView object is empty.
var win = Ti.UI.currentWindow;

var tf = Ti.UI.createTextField({
	left: 10,
	top: 5,
	width: 320,
	height: 40
});

var webView = Ti.UI.createWebView({
	top: 50,
	left: 10,
	width: 250,
	height: 300,
//	url: 'google.com/404',
	backgroundColor: '#AAD',
	loading: false,
	touchEnabled: false,
	
});

var but = Ti.UI.createButton({
	left: 400,
	top: 10,
	title: 'canGoBack',
	width: 200,
	height: 50
});

var but2 = Ti.UI.createButton({
	left: 400,
	top: 70,
	title: 'goBack',
	width: 200,
	height: 50
});

win.add(but2);
win.add(but);
win.add(tf);
win.add(webView);

tf.addEventListener('return',function(){
	webView.url = tf.value;
	});

but.addEventListener('click',function(){
	tf.value = webView.canGoBack();
});

but2.addEventListener('click', function(){
	webView.goBack();
});

Comments

  1. Maxim Negadaylov 2011-06-10

    We can`t access iframe history object from other domains
  2. Lee Morris 2017-03-10

    Closing ticket as the issue will not fix.

JSON Source