473,396 Members | 1,938 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

iframe not work with firefox

here is code that i use.

Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <head>
  3. </head>
  4. <body>
  5. <form>
  6.     <input type=checkbox name=source value=1 OnClick="SourceCode(source.checked)">Source
  7.     <input type=checkbox name=bold value=1 OnClick="RichtText('Bold')"><b>B</b>
  8.     <input type=checkbox name=under value=1 OnClick="RichtText('underline')"><u>U</u>
  9.     <input type=checkbox name=italic value=1 OnClick="RichtText('italic')"><i>I</i>
  10.  
  11.     <select name=align OnChange="RichAlign(this[this.selectedIndex].value)">
  12.         <option value="justifyleft" selected>Left</option>
  13.         <option value="justifycenter">Center</option>
  14.         <option value="justifyright">Right</option>
  15.     </select>
  16.  
  17.     <iframe class="mytext" width="100%" ID="mytext" height="200">
  18.     </iframe>
  19.  
  20.     <script langauge="JavaScript">
  21.         function RichtText(what) {
  22.             mytext.document.execCommand(what);
  23.             mytext.focus();
  24.         }
  25.  
  26.         function RichAlign(what) {
  27.             mytext.document.execCommand(what);
  28.             mytext.focus();
  29.         }
  30.  
  31.         function SourceCode(mode)
  32.         {
  33.             var htmtext;
  34.             if(mode) {
  35.                 htmtext=mytext.document.body.innerHTML;
  36.                 mytext.document.body.innerText=htmtext;
  37.             }
  38.             else {
  39.                 htmtext=mytext.document.body.innerText;
  40.                 mytext.document.body.innerHTML=htmtext;
  41.             }
  42.  
  43.         }    
  44.  
  45.         var bLoad=false
  46.         var pureText=true
  47.         var bodyTag="<body MONOSPACE STYLE=\"font:10pt arial,sans-serif\">"
  48.         var bTextMode=false
  49.         mytext.document.open();
  50.         mytext.document.write(bodyTag);
  51.         mytext.document.close();
  52.         mytext.document.designMode="On";
  53.     </script>
  54. </form>
  55.  
  56. </body>
  57. </html>
when open with firefox , can't type anything in iframe.

how to make it work in firefox
Aug 11 '06 #1
1 6107
Banfa
9,065 Expert Mod 8TB
It wouldn't work with Firefox because document.designMode is an MSIE extension.

However those nice people at Mozilla have written an article about obtaining the same functionality at

www.mozilla.org/editor/ie2midas.html
Aug 11 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: gsb | last post by:
Don't know if this is the right place to post this JavaScript issue. If not, could someone point me in the right direction please. I am trying to make a "cross browser compliant" floating...
12
by: wangzx | last post by:
I am the author of easyajax.sourceforge.net, and I have a problem on Firefox 1.5, I post the problem here and hopes somebody help me. The test page can be:...
14
by: Aaron Gray | last post by:
Hi, I want to access the properties of an IFrame but seem unable to get access to the IFrames document body. <html> <body> <iframe src="test.html" id="IFrame"></iframe> </body>
1
by: sam | last post by:
Hi all, Hope some expert can help me resolve this. I am using the following code to resize an iframe according to the content in it so that the iframe does not use its scroll bar and uses the...
12
by: mistral | last post by:
Can anybody tell me how to get source code of page in iframe? (popup window is clickable image). When I right click on this popup border to view source, i see just as follows <html> <head>...
1
by: Sura | last post by:
Hi I have a flash interactive window which has html links and this appears on an html page. This window can be moved with the mouse on the html page. The html page has an iFrame too. When the...
4
by: avdbrink | last post by:
I'm building an application wich should be used by other websites inside an iFrame. My app stores some sessionvariables, but sometimes in IE (6 and 7) IIS seems to restart the session on each...
1
by: SunshineInTheRain | last post by:
My project has 3 files, File1 has included master page. file1 consists of iframe1 that load file2. File2 consists of iframe2 that load file3. Javascript used on each file to resize the iframe...
10
by: worldwideebm | last post by:
This is a problem that i have googled for hours and can't find an answer so i resort to asking on here because i found similar question on here. I have a page i use, It has an iframe on it but it...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.