Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

300
Views
¿Cómo permitir que los usuarios de mi Producto1 marquen el enlace de mi Producto2 desde la página web del Producto1?

Estoy tratando de permitir que mi usuario marque el enlace de mi producto externo haciendo clic en el botón, pero tengo un problema con window.sidebar.addPanel y window.external.AddFavorite , ya que ambos no son compatibles ahora.

Tengo una aplicación PHP y busco las mejores soluciones adecuadas aquí.

estoy obteniendo

TypeError no detectado: window.sidebar.addPanel no es una función

error con el siguiente código.

 <head> <script type="text/javascript"> function AddToBookmark() { if (window.sidebar) { // Firefox window.sidebar.addPanel('Dottoro help page', 'http://help.dottoro.com', ''); } else { if (window.external && ('AddFavorite' in window.external)) { // Internet Explorer window.external.AddFavorite('http://help.dottoro.com', 'Dottoro help page'); } else { // Opera, Google Chrome and Safari alert("Your browser doesn't support this example!"); } } } </script> </head> <body> <button onclick="AddToBookmark();">Add to Bookmark</button> </body>

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Según esta respuesta

addPanel se eliminó de Firefox desde la versión 23. Pero puedes usar marcado en su lugar:

 <a href="http://stackoverflow.com" title="Stack Overflow" rel="sidebar">Bookmark me</a>

Por lo tanto, puede simular un clic en una etiqueta <a> similar en su función AddToBookmark() como se muestra a continuación.

 const anchorTag = document.createElement('a'); anchorTag.href = "http://help.dottoro.com" anchorTag.title= "Dottoro help page"; anchorTag.rel= "sidebar"; anchorTag.click(); 

 <body> <button onclick="AddToBookmark();">Add to Bookmark</button> <script type="text/javascript"> function AddToBookmark() { if (window.sidebar) { // Firefox const anchorTag = document.createElement('a'); anchorTag.href = "http://help.dottoro.com" anchorTag.title = "Dottoro help page"; anchorTag.rel = "sidebar"; anchorTag.click(); } else { if (window.external && ('AddFavorite' in window.external)) { // Internet Explorer window.external.AddFavorite('http://help.dottoro.com', 'Dottoro help page'); } else { // Opera, Google Chrome and Safari alert("Your browser doesn't support this example!"); } } } </script> </body>

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!