2013-04-08 39 views
0

我是新来的HTML/Javascript/Jquery,所以这个问题可能看起来很基本。 但我发现我想在Phonegap的应用程序中使用filebrowser online。 事情是,我下载的示例使用此方法打开文件浏览器。Javascript将无法正确打开Phonegap应用程序的文件浏览器 - 但HTML确实是

<a href="fileBrowser.html" data-role="button" data-inline="true" id="browseBtn">Browse</a> 

但我需要用Javascript来打开它,因为我只想要它时,我长按按钮。 但是这些方法都没有工作:

window.location.href = ("fileBrowser.html"); 
window.open("fileBrowser.html"); 

我称之为像这样(只是为了测试它是否工作):

<a onclick="test()" data-role="button" data-inline="true" id="browseBtn">Browse</a> 

它应该出来是这样的:

Working version from example

但是,不幸的是,当我使用Javascript时,它出现了: Nonworking, opened with javascript

回答

1

看起来像你使用jQuery Mobile?

使用此:

$.mobile.changePage("fileBrowser.html"); 
+0

终于成功了!谢谢! – Rad 2013-04-08 17:22:50

相关问题