Hi, I meant where in _your_ code (but that's still useful info), e.g., this call to setStyle:
this.editorFrame.setStyle( 'border: 1px inset;' ); (BTW, the semicolon inside the quotes there is an error, although most browsers will ignore it.) ...or this one: this.editorFrame.setStyle( { width: "100%", height: editorTextareaDims.height + 'px', className: this.editorTextarea.className }); ...and though actually, as they're both on editorFrame, I'm not sure how much it matters. Fundamentally, using Prototype's setStyle on an iframe seems to work, whether freshly-created or not: http://jsbin.com/epano3 http://jsbin.com/epano3/2 So it may be worthwhile trying to figure out what's different in your code vs. that working example. HTH, -- T.J. Crowder Independent Software Consultant tj / crowder software / com www.crowdersoftware.com On Jul 20, 4:20 pm, Gindi Bar Yahav <g.b.ya...@gmail.com> wrote: > OK, the bug in here > setStyle: function(element, styles) { > 2206 element = $(element); > 2207 var elementStyle = element.style, match; > 2208 if (Object.isString(styles)) { > 2209 element.style.cssText += ';' + styles; > 2210 return styles.include('opacity') ? > 2211 element.setOpacity(styles.match(/opacity:\s*(\d?\.?\d*)/)[1]) : > element; > 2212 } > 2213 for (var property in styles) > 2214 if (property == 'opacity') element.setOpacity(styles[property]); > 2215 else > 2216 elementStyle[(property == 'float' || property == 'cssFloat') ? > 2217 (Object.isUndefined(elementStyle.styleFloat) ? 'cssFloat' : > 'styleFloat') : > 2218 property] = styles[property]; > 2219 > 2220 return element; > 2221 }, > > element is null > [Break on this error] var elementStyle = element.style, match; > > (copied from firebug) > > thanks :) > > occured when uncommenting the prototype.js attach linke. > > On 20 יולי, 15:23, "T.J. Crowder" <t...@crowdersoftware.com> wrote: > > > > > Hi, > > > I don't think it's possible to help with this without a lot more > > information. What's `editorDocument`, for instance? You said that the > > failure occurs in `setStyle`; so you're going to need to show us your > > call to `setStyle` at the very least (or your call to whatever else in > > Prototype called `setStyle`). I don't think the code you've shown > > calls Prototype at all, although without knowing what `editorDocument` > > is... > > -- > > T.J. Crowder > > Independent Software Consultant > > tj / crowder software / comwww.crowdersoftware.com > > > On Jul 20, 1:34 am, Gindi Bar Yahav <g.b.ya...@gmail.com> wrote: > > > > Hey. > > > I have a question that I'll be glad if you can help me. > > > > I'm building a WYSIWYG editor based on prototype and I want to extend > > > prototype to the frame itself. > > > > I've written this code > > > > var htmlContent = ""; > > > htmlContent > > > = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 > > > Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">' + "\n" > > > > > > + "<html>\n" > > > > > > + " <head>\n" > > > > > > + ' <script type="text/javascript" > > > language="javascript" > > > src="http://localhost/PearCMS2/Public/JavaScripts/ThirdParty/ > > > prototype.js"></script>' + "\n" > > > > > > + ieCompatible > > > > > > + " </head>\n" > > > > > > + " <body>\n" > > > > > > + content > > > > > > + " </body>\n" > > > > > > + "</html>"; > > > > // Write it > > > this.editorDocument.open('text/html', > > > 'replace'); > > > this.editorDocument.write(htmlContent); > > > this.editorDocument.close(); > > > > but for some reason, when I'm attaching the prototype.js file it gives > > > me an error with FF - element can not be null, in the setStyle > > > function. > > > > in both IE7,8 and safari it works. > > > > Hope you can help me. > > > thanks! Yahav.-הסתר טקסט מצוטט- > > > -הראה טקסט מצוטט- -- You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.