Visualizzazione dei risultati da 1 a 2 su 2
  1. #1
    Utente di HTML.it L'avatar di fungo
    Registrato dal
    Jul 2000
    residenza
    Caorle
    Messaggi
    725

    Problema script addFavorite IE vs OPERA

    Ciao a tutti e buona domenica.
    Volevo chiedere come mai il codice sotto nonmi funzione, premetto che non sonomolto esperto con javascript.

    <script type="text/javascript"><!--
    function bookmark(bmurl, bmtitle){
    if( window.sidebar && window.sidebar.addPanel ) {
    //Gecko (Netscape 6 etc.) - add to Sidebar
    window.sidebar.addPanel( bmtitle, bmurl, '' );
    } else if( window.external && ( navigator.platform == 'Win32' ||
    ( window.ScriptEngine && ScriptEngine().indexOf('InScript') + 1 ) ) ) {
    //IE Win32 or iCab - checking for AddFavorite produces errors for no
    //good reason, so I use a platform and browser detect.
    //adds the current page page as a favourite; if this is unwanted,
    //simply write the desired page in here instead of 'location.href'
    window.external.AddFavorite( bmurl, dbmtitle );
    } else if( window.opera && window.print ) {
    //Opera 6+ - add as sidebar panel to Hotlist
    return true;
    } else if( document.layers ) {
    //NS4 & Escape - tell them how to add a bookmark quickly (adds current page,
    //not target page)
    window.alert( 'Please click OK then press Ctrl+D to create a bookmark' );
    } else {
    //other browsers - tell them to add a bookmark (adds current page, not target page)
    window.alert( 'Please use your browser\'s bookmarking facility to create a bookmark' );
    }
    return false;
    }
    --></script>


    Grazie
    Mungo Mauro

  2. #2
    Moderatore di JavaScript L'avatar di br1
    Registrato dal
    Jul 1999
    Messaggi
    19,998
    Ma non avevi gia' una discussione sullo stesso argomento? e' solo poche righe sotto.. VVoVe:

    Rispetta il regolamento
    Il guaio per i poveri computers e' che sono gli uomini a comandarli.

    Attenzione ai titoli delle discussioni: (ri)leggete il regolamento
    Consultate la discussione in rilievo: script / discussioni utili
    Usate la funzione di Ricerca del Forum

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.