Visualizzazione dei risultati da 1 a 3 su 3

Discussione: Tag grassetto Mozilla

  1. #1
    Utente di HTML.it
    Registrato dal
    Mar 2003
    Messaggi
    393

    Tag grassetto Mozilla

    Uso degli script del tipo:

    Codice PHP:
    function addFilm(tagNamef) {
        var 
    txtarea document.post.textbody;
        
    txtarea.focus();
        
    theSelection false;
        
    theSelection document.selection.createRange().text// Get text selection
        
        
    if (theSelection) {
            
    // Add tags around selection
            
    document.selection.createRange().text "“[b][i]" theSelection "[/i][/b]”";
            
    txtarea.focus();
            
    theSelection '';
            return;
            
    storeCaret(txtarea);
        } else {
            var 
    elem=f.textbody;
            
    what "a";
             if(
    what!="undefined"elem.value+=" “ &rdquo";
        }

    richiamati poi con input del tipo:

    Codice PHP:
    <input type="button" class="button" onclick="addTag('a',this.form);" style="width: 80px" name="aButton" value="Link esterno" /> 
    Solo che funzionano solo con Explorer. Cosa devo fare per farli funzionare anche con Mozilla?

    Grazie

  2. #2
    Utente di HTML.it L'avatar di Xinod
    Registrato dal
    Sep 2000
    Messaggi
    13,649
    thread vecchissimo, ma non e' cambiato nulla nel frattempo
    http://forum.html.it/forum/showthrea...67#post8288267
    sistemalo per quello che ti serve fare, il concetto e' quello
    ciao

  3. #3
    Utente di HTML.it
    Registrato dal
    Mar 2003
    Messaggi
    393
    In realtà mi sono sbagliato:
    Il bbcode con mozilla non mi dà problemi. me lo dà il window.prompt tipo:

    Codice PHP:
    function addTag(tagNamef) {
        var 
    txtarea document.post.textbody;
        
    txtarea.focus();
        
    theSelection false;
        
    theSelection document.selection.createRange().text// Get text selection
        
        
    if (theSelection) {
            
    // Add tags around selection
            
    document.selection.createRange().text "["+tagName+" href=\"http://"+theSelection+"\" target=\"_blank\"]"theSelection "[/"+tagName+"]";
            
    txtarea.focus();
            
    theSelection '';
            return;
            
    storeCaret(txtarea);
        } else {
            var 
    elem=f.textbody;
             var 
    what=window.prompt("Inserire l'indirizzo del sito da linkare ESCLUSO [url]http://[/url] ");
             if(
    what!="undefined"elem.value+=" ["+tagName+" href=\"http://"+what+"\" target=\"_blank\"]"+what+"[/"+tagName+"]";
        }

    richiamato con:

    Codice PHP:
    <input type="button" class="button" onclick="addTag('a',this.form);" style="width: 80px" name="aButton" value="Link esterno" /> 

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.