| Author |
Message |
David Norman Member |
# Posted: 1 Jan 2011 12:49
Hi All,
I've made the following modification to wyzz.js:
At the top of the file, remove the definition of wyzzW and wyzzH.
At the top of make_wyzz(), add the following code:
// Get the width and height
text_area = document.getElementById( textareaID );
wyzzW = text_area.offsetWidth;
wyzzH = text_area.offsetHeight;
Having made this change, the width and height of the editor is now set to the width and height of the textarea, rather than being pre-set in the js file, so you can set it via css.
David.
|
heritage Member |
# Posted: 2 Mar 2011 16:52
This does not seem to work with Internet Explorer 8. The message I insert in the text area works with Firefox and works with IE8 with the original hard coded size.
As far as I know, text_area.offsetWidth is supported by IE8.
(Javascript is a nightmare with no standards and different code for Mozilla and IE on many properties. Is this one of those?)
|
David Norman Member |
# Posted: 2 Mar 2011 17:37 - Edited by: David Norman
Can you define "does not seem to work". What does it do?
I've used the above change as part of a site I've developed, and I've just checked it in IE8, and it works fine.
David.
|
heritage Member |
# Posted: 2 Mar 2011 21:41
First of all, thanks for your original posting; works great for me with Firefox.
Details of my problem. I have a script which captures user input and uses the latest WYZZ script. The form on that script sends 'the Message' via POST to a handler. {The handler is probably not relevant but can describe if needed. Both scripts use php but the user input is pure, simple HTML.}
The default message in the textarea is obtained from a database table.
Firefox does just what I want but IE 8 with your mod displays the WYZZ icons but no textarea. The source code looks correct:
{I can't remember if code is allowed here or not so used * for tags.}
*textarea name="theMessage" id="theMessage" cols="125" rows="6"*Please check the <span style="font-weight: bold;"*Forum </span>(under Ancestors) for postings of interest to the Genealogy SIG.*/textarea>
*script language="javascript1.2"*
make_wyzz('theMessage');
*/script*
However, IE 8 displays the WYZZ icons but no textarea and won't accept input.
I can live with the hard coded version but I am always curious when I run across a problem.
Thanks
|
David Norman Member |
# Posted: 2 Mar 2011 21:54
Hmm...
Is IE reporting any errors on the page?
Have you got a control with an ID of "text_area"? IE doesn't like having a JS variable and an element ID that match.
Failing that, is there any way I can see your code on a server, to see the problem myself?
David.
p.s. In response to your original statement that "Javascript is a nightmare with no standards and different code for Mozilla and IE on many properties"... There are standards for Javascript. It's just that IE refuses to stick to them!
|
heritage Member |
# Posted: 2 Mar 2011 22:20
I tried to post a URL to a page with the code but couldn't get past the censor. I will try tomorrow - have a Coast Guard meeting at 7PM.
I run a SMF forum which allows personal messages. Does this one?
|
David Norman Member |
# Posted: 2 Mar 2011 23:29 - Edited by: David Norman
If you can't get around it, e-mail me off-list. wyzz at ellought dot demon dot co dot uk
If we find anything useful, we can post conclusions here.
David.
|
David Norman Member |
# Posted: 3 Mar 2011 10:05
Thanks for sending over some sample code. The problem looks to be, if you have the following code (which I've abbreviated):
<table>
<tr>
<td>
<textarea id="myTestArea"></textarea>
<script>my_func()</script>
</td>
</tr>
</table>
<script>my_func()</script>
If my_func() looks at offsetWidth (or offsetHeight) for myTextArea, then during the first call, it has a value of 0, while during the second call, it has the actual width of the text area. It looks like IE doesn't resolve the size of the text area size until the table is complete. This is the case whether you use rows="123", cols="12", or whether you use style="width: 200px; height: 100px" to set the size of the text area.
Having said that, I have a site I've built, where this isn't a problem. So IE only has this problem sometimes! I haven't managed to pin down the details as to when it is/isn't a problem. Anyone got any further thoughts?
David.
|
shownoob Member |
# Posted: 7 Apr 2011 15:21
Thank you !!
___________________________
|