Salve a tutti, guardando il post , dove ANDR3A ha scritto questa funzione per ignettare codice in Fckeditor, ho provato a copiarla in una pagina ma non funziona...
Ecco l'intera pagina dove viene creato l'oggetto Fckeditor, non so se il codice di ANDR3A va copiato qui:
se sapete come far funzionare questa funzione per inserire del codice esterno in fckeditor...aiutatemi!codice:<head> <title>FCKeditor - Sample</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta name="robots" content="noindex, nofollow"> <link href="../sample.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="../../fckeditor.js"></script> <script> // funzione per raggiungere l'iframe di FCK function getIframe(who, id) { return who.getElementById(id).contentWindow.document; } // funzione per raggiungere l' area dentro i 2 iframes function getArea() { var o = getIframe(document, 'desc___Frame'); var s = getIframe(o, 'oFCKeditor'); return s['body']; } // funzione per schiaffarci un immagine // Esempio: addImage('pippo.jpeg'); function addImage(what) { // mi becco l'area var o = getArea(); // ignetto l' html che mi pare o.innerHTML += 'caga'; } </script> </head> <body> <form action="sampleposteddata.asp" method="post" target="_blank"> <script type="text/javascript"> <!-- // Automatically calculates the editor base path based on the _samples directory. // This is usefull only for these samples. A real application should use something like this: // oFCKeditor.BasePath = '/fckeditor/' ; // '/fckeditor/' is the default value. var sBasePath = document.location.pathname.substring(0,document.location.pathname.lastIndexOf('_samples')) ; var oFCKeditor = new FCKeditor( 'FCKeditor1' ) ; oFCKeditor.BasePath = sBasePath ; oFCKeditor.Height = 300 ; oFCKeditor.Value = 'This is some [b]sample text<\/strong>. You are using <a href="http://www.fckeditor.net/">FCKeditor<\/a>.' ; oFCKeditor.Create() ; //--> </script> <input type="button" value="AGGIUNGI IMMAGINE" onclick="addImage('pippo.jpg');"> <input type="submit" value="Submit"> </form> </body>
Ciao a tutti,
Marco

Rispondi quotando