jquerymobile";另存为书签";jquery mobile中的按钮,用于我的图书馆图书列表,

jquerymobile";另存为书签";jquery mobile中的按钮,用于我的图书馆图书列表,,jquery,mobile,ionic-framework,Jquery,Mobile,Ionic Framework,你好,朋友们……请帮助我在jquery mobile中为我的图书馆图书列表创建一个“另存为书签”按钮,您可以在其他页面查看书签图书或删除它们 该应用程序包含书籍和一个列表视图,就像书店一样,你点击的任何书籍都可以添加书签试试这个小功能: JavaScript: <script type="text/javascript"> //First, set jQuery in no conflict mode, to avoid conflicts with other libra

你好,朋友们……请帮助我在jquery mobile中为我的图书馆图书列表创建一个“另存为书签”按钮,您可以在其他页面查看书签图书或删除它们


该应用程序包含书籍和一个列表视图,就像书店一样,你点击的任何书籍都可以添加书签

试试这个小功能:

JavaScript:

  <script type="text/javascript">

  //First, set jQuery in no conflict mode, to avoid conflicts with other libraries
  var $ = jQuery.noConflict();
  //Then proceed with code
  $(document).ready(function() {
    $("#bookmarkme").on("click", function() {
      if (window.sidebar) { // Mozilla Firefox Bookmark
        window.sidebar.addPanel(location.href,document.title,"");
      } else if(window.external) { // IE Favorite
        window.external.AddFavorite(location.href,document.title); }
      else if(window.opera && window.print) { // Opera Hotlist
        this.title=document.title;
        return true;
  }
});
</script>
<a id="bookmarkme" href="#" rel="sidebar" title="bookmark this page">Bookmark This Page</a>

//首先,将jQuery设置为无冲突模式,以避免与其他库发生冲突
var$=jQuery.noConflict();
//然后继续代码
$(文档).ready(函数(){
$(“#bookmarkme”)。在(“单击”,函数(){
if(window.sidebar){//Mozilla Firefox书签
window.sidebar.addPanel(location.href,document.title,“”);
}else if(window.external){//IE收藏夹
window.external.AddFavorite(location.href,document.title);}
else if(window.opera&&window.print){//opera热列表
this.title=document.title;
返回true;
}
});
HTML:

  <script type="text/javascript">

  //First, set jQuery in no conflict mode, to avoid conflicts with other libraries
  var $ = jQuery.noConflict();
  //Then proceed with code
  $(document).ready(function() {
    $("#bookmarkme").on("click", function() {
      if (window.sidebar) { // Mozilla Firefox Bookmark
        window.sidebar.addPanel(location.href,document.title,"");
      } else if(window.external) { // IE Favorite
        window.external.AddFavorite(location.href,document.title); }
      else if(window.opera && window.print) { // Opera Hotlist
        this.title=document.title;
        return true;
  }
});
</script>
<a id="bookmarkme" href="#" rel="sidebar" title="bookmark this page">Bookmark This Page</a>

编辑:

如果您没有在服务器上运行IE,IE将显示一个错误(当以
file://....