473,794 Members | 2,708 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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._c ontent.document .getElementById ("RTEContent")) ;
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 2899
I might well be wrong, but from my (limited) experience dealing with
DIVs (and other elements for that matter) -
alert(document. getElementById( "RTEContent").v alue) 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._c ontent.document .getElementById ("RTEContent")) ;
This alert message gives "null".

The DIV element is declared in a IFRAME.


Give that frame a name attribute e.g.
<iframe name="iframeNam e"
then you can script e.g.
var iframe = window.frames.i frameName;
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.fr ames['RTEContent']);
you should get a referance to the iframe.

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

In the chrome the XPCNativeWrappe r=yes by default for Firefox 1.5

How do i over write this to XPCNativewrappe r=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 XPCNativewrappe r
but does not work.

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

In the chrome the XPCNativeWrappe r=yes by default for Firefox 1.5

How do i over write this to XPCNativewrappe r=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 XPCNativewrappe r
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
1403
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 websites and the script will loop through the page after its loaded and perhaps for each element do something like throw an alert() with the style rules. I can call the style() method on each element to get its rules, but how do I get every element?
3
6553
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
11783
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 parent's parent the <tr> node in Firefox? Internet Explorer seems to think so. How can I get the <tr> node (so I can iterate through its children) in Firefox? Why does this stuff have to be such a humongous god-forsaken
6
13378
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... html file (generated using .NET 2.0 beta2): <form method="post" action="Test2.aspx" id="form1">
10
23293
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
2813
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. Is that something that isn't there for all elements that are correctly formed, or possibly something that disappears due to malformed HTML? Or is there any other code-related reason (i.e., mistake) that causes it to disappear?
3
2277
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= "fieldName"; this.inputElement.type = "text"; this.inputElement.value = "somevalue"; ....
5
2971
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 have a script tag, that document.write's some HTML. Like this:
8
3158
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 + '"'); I am adding a SVG shape to the page. Here is the Shape :
15
3731
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 element in Firefox.
0
10433
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10212
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10161
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7538
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6777
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5436
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5560
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4112
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2919
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.