473,396 Members | 1,895 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 (Designmode='on') onFocus FireFox

Hi!

I have an Iframe, and I want to run a script, if the user clicks on it (onfocus). It's working fine in IE but in FireFox it doesn't work with designmode='on'.

Anybody has a solution for this problem?

Greetings

FireGlow
Jun 15 '06 #1
1 8470
xwero
99
Maybe you can update the iframe on keydown. The bad thing about this is you have to write the proper actions for the different keys.

The example is crude jquery code.
Expand|Select|Wrap|Line Numbers
  1. $('iframe.edit').keydown(function(){
  2.    var key = e.charCode || e.keyCode || 0;
  3.    if(key == 13){
  4.        // enter action
  5.    }elseif(key == 8){
  6.       // backspace action
  7.    }else{
  8.       $(this).append(String.fromCharCode(key));
  9.    }
  10. });
  11.  
an article on creating a wysiwyg editor you can find at http://www.webreference.com/programming/javascript/gr/column12/

the advantage of this code is you don't have to use a iframe you could use a paragraph, a div, a span, or another element you want to change by attaching a class. But that's how i would do it.
Feb 10 '07 #2

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

Similar topics

4
by: Jay Xx | last post by:
I have an IFrame in design mode. I've tried a bunch of things to capture key presses in that IFrame, but I can't seem to get it. I can capture key presses outside the IFrame fine. I have this...
2
by: Arena | last post by:
Hi! Having multiple iframe wysiwyg editor I would to use only one shared toolbar. Can anybody help me, how to detect where is focus. Thank You, Arcady Voronin
5
by: Larry | last post by:
I'm currently using designMode in a page, and it's been working for IE6 on Windows, but I'm hearing complaints that it's not working on IE6 on Mac. I had done some research on this before deciding...
2
by: sahista | last post by:
Hello. I create an iframe on the fly, set it to editable designMode='on' and insert into iframe.contentWindow.childNodes.childNodes some innerHTML. Ok... that all works fine in IE but in...
9
by: DL | last post by:
That is, for an iframe with onload attribute to preset a width and height then depending on the length of its content to auto-expand instead of scrolling. The following URL is quite interesting,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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.