Шукати в статтях підтримки

Остерігайтеся нападів зловмисників. Mozilla ніколи не просить вас зателефонувати, надіслати номер телефону у повідомленні або поділитися з кимось особистими даними. Будь ласка, повідомте про підозрілі дії за допомогою меню “Повідомити про зловживання”

Learn More

Ця тема перенесена в архів. Якщо вам потрібна допомога, запитайте.

HTML code not working Firefox 29

  • 2 відповіді
  • 2 мають цю проблему
  • 6 переглядів
  • Остання відповідь від Kohei

more options

The following code used to work under older Firefox versions. It still works under IE 8, but not Firefox 29. The purpose of the code is that clicking on "Click Here to bookmark this webpage!" add the URL www.google.com in my bookmarks (i had to replace <> with [])

[html]
[head]
[title]VPSIR VULNERABILITY[/title]
[link rel="stylesheet" type="text/css" href="Themes/Gray/Style.css"]
[/head]
[body link="#0000ff" vlink="#0000ff" alink="#ff0000" bgcolor="#ffffff" text="#000000" class="GrayPageBODY"]
[a class="GrayDataLink" href="Menu.html"]Menu[/a]
[script src="JS/sorttable.js" type="text/javascript"]
[/script]
  
[p][p] 
[script]
   function bookmark(title, url)
   {
      if (window.sidebar) // firefox
      {
         window.sidebar.addPanel(title, url, "");
      }
      else if (window.opera && window.print) // opera
      {
         var element = document.createElement("a");
         element.setAttribute("href", url);
         element.setAttribute("title", title);
         element.setAttribute("rel", "sidebar");
         element.click();
      } 
      else if (document.all) // ie
      {
         window.external.AddFavorite(url, title);
      }
   }
[/script]
[center]
[div style="cursor:pointer"  onclick="bookmark('Google', 'www.google.com')"]
[font size="6"][strong][big]Click Here to bookmark this webpage![/big][/strong][/font][/div]
[/center]
[p]
[/html]
The following code used to work under older Firefox versions. It still works under IE 8, but not Firefox 29. The purpose of the code is that clicking on "Click Here to bookmark this webpage!" add the URL www.google.com in my bookmarks (i had to replace <> with []) <pre><nowiki> [html] [head] [title]VPSIR VULNERABILITY[/title] [link rel="stylesheet" type="text/css" href="Themes/Gray/Style.css"] [/head] [body link="#0000ff" vlink="#0000ff" alink="#ff0000" bgcolor="#ffffff" text="#000000" class="GrayPageBODY"] [a class="GrayDataLink" href="Menu.html"]Menu[/a] [script src="JS/sorttable.js" type="text/javascript"] [/script] [p][p] [script] function bookmark(title, url) { if (window.sidebar) // firefox { window.sidebar.addPanel(title, url, ""); } else if (window.opera && window.print) // opera { var element = document.createElement("a"); element.setAttribute("href", url); element.setAttribute("title", title); element.setAttribute("rel", "sidebar"); element.click(); } else if (document.all) // ie { window.external.AddFavorite(url, title); } } [/script] [center] [div style="cursor:pointer" onclick="bookmark('Google', 'www.google.com')"] [font size="6"][strong][big]Click Here to bookmark this webpage![/big][/strong][/font][/div] [/center] [p] [/html]</nowiki></pre>

Змінено cor-el

Усі відповіді (2)

more options

That was removed all the way back in Firefox 23.

If you need to provide a sidebar in Firefox, your choices are to either build an extension or use the social API.

more options

Firefox has never provided an API to add a bookmark from a Web page. window.sidebar.addPanel was a method to add a sidebar panel literally. IE's external.AddFavorite has also been deprecated. You should not use the method.