Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Code works with IE7, FF3.5 but not IE8 and Why?

Reply
Thread Tools

Code works with IE7, FF3.5 but not IE8 and Why?

 
 
DL
Guest
Posts: n/a
 
      04-21-2010

....
<script type="text/javascript">

function setFrm() {
var fh = document.getElementById('txt');
fh.style.width = (screen.width - 60);
fh.style.height = (screen.height - 330);
}

</script>
....
<body onload="setFrm();">
....
<iframe id="txt" name="txt" contenteditable="true"></iframe>

OUTCOME: the above is working across IE7/8 and Firefox3.5.

<img onclick="var x =
frames['txt'].document.selection.createRange();x.execCommand('I nsertOrderedList');x.select();"
src="icons/list_ordered.gif" style="valign:bottom;width:25;height:
20" />

OUTCOME: the above Ordered List function is not working with IE8 while
it works with both IE7 and Firefox3.5, specifically, upon click,
order number goes out of the iframe instead of being inside,
how come? How can we fixt it?

(I understand when the Style of Width and Height for the iframe is set
within the iframe element, this is not an issue but I'd like to set
the iframe's width and height dynanically).

Thanks in advance.

 
Reply With Quote
 
 
 
 
Joe Nine
Guest
Posts: n/a
 
      04-21-2010
DL wrote:
> <script type="text/javascript">
>
> function setFrm() {
> var fh = document.getElementById('txt');
> fh.style.width = (screen.width - 60);
> fh.style.height = (screen.height - 330);
> }
>
> </script>



You need to add "px" to it.

fh.style.width = (screen.width - 60)+"px";
fh.style.height = (screen.height - 330)+"px";
 
Reply With Quote
 
 
 
 
DL
Guest
Posts: n/a
 
      04-21-2010
On Apr 21, 10:47*am, Joe Nine <(E-Mail Removed)> wrote:
> DL wrote:
> > <script type="text/javascript">

>
> > function setFrm() {
> > * *var fh = document.getElementById('txt');
> > * * * * * * * * * *fh.style.width = (screen.width- 60);
> > * * * * * * * * * *fh.style.height = (screen.height - 330);
> > * *}

>
> > </script>

>
> You need to add "px" to it.
>
> fh.style.width = (screen.width - 60)+"px";
> fh.style.height = (screen.height - 330)+"px";



Great catch. I just did, still to no avail (same problem). What else
could we try? Thanks.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ie8!=ie8 cecile Javascript 2 05-24-2010 09:04 AM
Re: Advantages of IE8/64 over IE8/32 PA Bear [MS MVP] Windows 64bit 0 08-17-2009 09:43 PM
When I turn on my PC, it works, works, works. Problem! Fogar Computer Information 1 01-17-2006 12:57 AM
[py2exe.i18n] English works, German works, but not French. What do I miss? F. GEIGER Python 3 08-06-2004 10:01 AM
After rebooting my PC works, works, works! Antivirus problem? Adriano Computer Information 1 12-15-2003 05:30 AM



Advertisments