Jquery mobile 需要jquery mobile中的搜索或查找功能(phonegap)

Jquery mobile 需要jquery mobile中的搜索或查找功能(phonegap),jquery-mobile,cordova,Jquery Mobile,Cordova,我需要在我的应用程序中实现搜索功能(与记事本控件F相同)。我有一组数据需要搜索它是否存在。数据不在列表视图中。它就像我们在记事本中写一些东西一样,然后我们搜索任何工作。这可能吗。? 你能告诉我怎么做吗。? 请提供一些示例。也许您可以使用窗口。查找(aString、aCaseSensitive、aBackwards、awrappound、aWholeWord、aSearchInFrames、aShowDialog) aString:要搜索的文本字符串 aCaseSensitive:布尔值。如果为

我需要在我的应用程序中实现搜索功能(与记事本控件F相同)。我有一组数据需要搜索它是否存在。数据不在列表视图中。它就像我们在记事本中写一些东西一样,然后我们搜索任何工作。这可能吗。? 你能告诉我怎么做吗。?
请提供一些示例。

也许您可以使用
窗口。查找(aString、aCaseSensitive、aBackwards、awrappound、aWholeWord、aSearchInFrames、aShowDialog)

  • aString:要搜索的文本字符串
  • aCaseSensitive:布尔值。如果为true,则指定区分大小写的搜索
  • 向后看:布尔型。如果为true,则指定向后搜索
  • awrapparound:Boolean。如果为true,则指定环绕搜索
  • aWholeWord:布尔型。如果为true,则指定整词搜索
  • aSearchInFrames:布尔值。如果为true,则指定以帧为单位的搜索
  • aShowDialog:布尔值。如果为true,则指定显示对话框

例如:


jQuery移动嵌套列表
函数findText(str)
{
如果(str==“”){
警报(“请输入一些要搜索的文本!”);
返回;
}
if(window.find){
window.find(str,false,false,true,false,true,false);
}
}
$(文档).on('单击','搜索'),函数(){
findText(“废话”);
});
查找页面
文本输入:
诸如此类的测试诸如此类的测试

<!DOCTYPE html>
<html>

    <head>
        <title>jQuery Mobile Nested List</title>
        <meta name="viewport" content="width=device-width, initial-scale=1" />
        <link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.1/jquery.mobile-1.3.1.min.css" />
        <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
        <script src="http://code.jquery.com/mobile/1.3.1/jquery.mobile-1.3.1.min.js"></script>
        <script type="text/javascript">
        function findText (str) 
        {
            if (str === "") {
                alert ("Please enter some text to search!");
                return;
            }

            if (window.find) {
                window.find (str, false, false, true, false, true, false);
            }
        }

        $(document).on('click', '#search', function () {
            findText("blah");
        });
    </script>
    </head>

    <body>
        <div id="list-page" data-role="page">
            <div data-role="header">
                 <h1>Find Page</h1>

            </div>
            <div data-role="content">
                <label for="search-field">Text Input:</label>
                <p> blah this is a test blah this is a test blah</p>
                <input type="button" name="search" id="search" value="Search"/>
            </div> 
        </div>
    </body>

</html>