473,387 Members | 3,821 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,387 software developers and data experts.

DIV element in firefox

I have a Rich text editor which is a DIV element. I am not able to
capture the value of this element.i am working in firefox browser.

alert(window._content.document.getElementById("RTE Content"));
This alert message gives "null".

The DIV element is declared in a IFRAME.
Have i missed somthing in referring to the div element? Help me.

Jan 10 '06 #1
5 2880
I might well be wrong, but from my (limited) experience dealing with
DIVs (and other elements for that matter) -
alert(document.getElementById("RTEContent").value) should work.
Provided you replace the ".value" property with whatever it is you are
trying to access.

I am sure I am wrong, there's no way it could be that simple...

Jan 10 '06 #2


tweety wrote:
I have a Rich text editor which is a DIV element. I am not able to
capture the value of this element.i am working in firefox browser.
Mozilla only supports editable iframes where the designMode property is
set to on. It is not possible to have only a single div that is editable.
alert(window._content.document.getElementById("RTE Content"));
This alert message gives "null".

The DIV element is declared in a IFRAME.


Give that frame a name attribute e.g.
<iframe name="iframeName"
then you can script e.g.
var iframe = window.frames.iframeName;
if (iframe && iframe.document && iframe.document.getElementById) {
var div = iframe.document.getElementById('RTEContent');
if (div) {
// now use div here
}
}

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jan 10 '06 #3
>The DIV element is declared in a IFRAME.
Have i missed somthing in referring to the div element? Help me.


I might be totally wrong, but with windows other than the main one, you
have to either access by the array or by name. While I think firefox
allows for getElementById(); method, you should use window.frames[]
instead so you can also support Internet Explorer.

Name your div RTEContent like you did with Id

Then if you use alert(window.frames['RTEContent']);
you should get a referance to the iframe.

Jan 10 '06 #4
The problem is with XPCNativeWrapper. In the alert statement the object
is displayed as object XPCNativewrapper[object HtmlDivElement]

In the chrome the XPCNativeWrapper=yes by default for Firefox 1.5

How do i over write this to XPCNativewrapper=no?

Is there a solution that could be used in the javascript code to
access the dom objects?
does this always happen with iframe?

I referreed to the documentation in mozilla site and tried out
explicit XPCNativewrapper
but does not work.

Jan 12 '06 #5
The problem is with XPCNativeWrapper. In the alert statement the object
is displayed as object XPCNativewrapper[object HtmlDivElement]

In the chrome the XPCNativeWrapper=yes by default for Firefox 1.5

How do i over write this to XPCNativewrapper=no?

Is there a solution that could be used in the javascript code to
access the dom objects?
does this always happen with iframe?

I referreed to the documentation in mozilla site and tried out
explicit XPCNativewrapper
but does not work.

Jan 12 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: lawrence | last post by:
I've a graphic designer who wants to be able to see what he's styled and what he so far hasn't. So I'd like to write a script that will work in, say, FireFox, so that he can point FireFox at has...
3
by: pantagruel | last post by:
The following does not work in firefox: <script defer="defer"> var x=document.getElementsByName("repositoryNamespace") alert(x.length + " elements!")
3
by: Christopher Benson-Manica | last post by:
I have an HTMLInputElement in a <td>. I want to access all the <td>'s in the same row as the input element. var tr=theInputElement.parentNode.parentNode; Why isn't the input element's...
6
by: Luke Dalessandro | last post by:
I'm not sure if this is the correct forum for platform specific (Mozilla/Firefox) javascript problems, so just shout and point me to the correct newsgroup if I'm being bad. Here's the deal... ...
10
by: Noozer | last post by:
Is it possible to detect where on a page the click occurred when the OnClick event of the BODY tag is fired? Thx
4
by: Steve | last post by:
I thought that this was available for all elements in Firefox, but recently had a page where a div didn't have it. I put in an id style for it, thinking that would do the trick, but it didn't. ...
3
by: vincentshiu | last post by:
I need to dynamic create input element in some cases, and I use javascript to do that, like the following code: .... var inputElement = document.createElement("input"); this.inputElement.name=...
5
by: SuneR | last post by:
Hi, I am having problems figuring out how to make Firefox behave, and output the HTML I want it to output. The thing I want done is actually quite simple. I have a <labeltag, and inside it, I...
8
by: Sunny | last post by:
Hi, I am creating an Element on page in Firefox. But It gives me an error in Firefox. String contains an invalid character" code: "5 county = document.createElement('"' + countyVMLtext +...
15
by: Sunny | last post by:
Hi, I can change the lement opacity in IE using. abc.style.filter = 'alpha(opacity=' + 10 + ')'; But this dont work in firefox, In firefox it throws error. How I can change the opacity of an...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.