Hi!
I have been using javascript in HTML Page to write some text in a div, by using document.write(""); which work perfectly in IE Browser, but not in mozilla.
Can you please tell me what code should i use so that work in all the Browser.
8 1624
Hi!
I have been using javascript in HTML Page to write some text in a div, by using document.write(""); which work perfectly in IE Browser, but not in mozilla.
Can you please tell me what code should i use so that work in all the Browser.
document.write("") should work on all browsers.
Show your code.
The code i am putting is in DIV and when i wirte any thing in div it work in morzilla but text in document.write does not work in mozilla thus the div text is not diplayed in morzilla but visible in IE - <div id='div1' style="display:none;">
-
<form name="tcol">
-
<script type="text/javascript">
-
xmlDoc=loadXMLDoc("PMA_Portfolio.xml");
-
var x=xmlDoc.getElementsByTagName("units/unit");
-
var y=xmlDoc.getElementsByTagName("leases/lease");
-
-
x.item(0).setAttribute("ref","Unit");
-
x.item(0).setAttribute("strung_address","Address");
-
y.item(0).setAttribute("current_tenant_ref","Tenant");
-
y.item(0).setAttribute("tenant_party_to_lease","Name");
-
y.item(0).setAttribute("ref","Lease Ref.");
-
y.item(0).setAttribute("term_start_date","Lease Start Date");
-
y.item(0).setAttribute("term_end_date","Lease End Date");
-
y.item(0).setAttribute("next_review_date","Next Review");
-
y.item(0).setAttribute("lease_type_code","Lease");
-
y.item(0).setAttribute("property_analysis_code","Unit Property");
-
y.item(0).setAttribute("passing_rent","Passing Rent");
-
-
document.write("<p><A HREF=javascript:void(0) onclick=selectAll()>Select All</A> | <A HREF=javascript:void(0) onclick=deselectAll()>Deselect All</A></p>");
-
document.write("<input type='checkbox' name='coffee' id='col1' value='Unit' checked />");
-
document.write(x[0].getAttribute('ref'));
-
document.write("<br />");
-
document.write("<input type='checkbox' name='coffee' id='col2' value='Address' checked />");
-
document.write(x[0].getAttribute('strung_address'));
-
document.write("<br />");
-
document.write("<input type='checkbox' name='coffee' id='col3' value='Tenant' checked />");
-
document.write(y[0].getAttribute('current_tenant_ref'));
-
document.write("<br />");
-
document.write("<input type='checkbox' name='coffee' id='col4' value='Name' checked />");
-
document.write(y[0].getAttribute('tenant_party_to_lease'));
-
document.write("<br />");
-
document.write("<input type='checkbox' name='coffee' id='col5' value='Lease Ref.' checked />");
-
document.write(y[0].getAttribute('ref'));
-
document.write("<br />");
-
document.write("<input type='checkbox' name='coffee' id='col6' value='Lease Term' checked />");
-
document.write("Lease Term" + "<br />");
-
document.write("<input type='checkbox' name='coffee' id='col7' value='Lease Start Date' checked />");
-
document.write(y[0].getAttribute('term_start_date'));
-
document.write("<br />");
-
document.write("<input type='checkbox' name='coffee' id='col8' value='Lease End Date' checked />");
-
document.write(y[0].getAttribute('term_end_date'));
-
document.write("<br />");
-
document.write("<input type='checkbox' name='coffee' id='col9' value='Next Review' checked />");
-
document.write(y[0].getAttribute('next_review_date'));
-
document.write("<br />");
-
document.write("<input type='checkbox' name='coffee' id='col10' value='Lease' checked />");
-
document.write(y[0].getAttribute('lease_type_code'));
-
document.write("<br />");
-
document.write("<input type='checkbox' name='coffee' id='col11' value='Unit Property' checked />");
-
document.write(y[0].getAttribute('property_analysis_code'));
-
document.write("<br />");
-
document.write("<input type='checkbox' name='coffee' id='col12' value='Passing Rent' checked />");
-
document.write(y[0].getAttribute('passing_rent'));
-
document.write("<br />");
-
document.write("<input type='checkbox' name='coffee' id='col13' value='Rateable Value' checked />");
-
document.write("Rateable Value" + "<br />");
-
document.write("<input type='checkbox' name='coffee' id='col14' value='Area' checked />");
-
document.write("Area" + "<br />");
-
document.write("<p class='bot'><input type='button' onclick='show()' value='Save'> <input type='button' onclick='cancel()' value='Cancel'></p>");
-
</script>
-
</form>
-
</div>
Actuall it is DOM code which is not working, so can you give the code for writing the DOM in mozilla.
IE and W3C-compliant browsers treat whitespace between nodes differently - see this link.
IE and W3C-compliant browsers treat whitespace between nodes differently - see this link.
I have gone to the link you provided, i tried it but it did't work out. It is due to DOM coding in mozilla.
Show the code for the XML file.
- <property ref="1">
-
<units>
-
<unit property_ref="1" ref="1" description="description" search_name="Tower House" address_line_1="TEMPORARY ID Unit 1 - Converted li" building_name="Tower House" road_number="25-32" road_name_1="Bloomsbury Street" road_name_2="" town="LONDON" county="" postcode="WC1B 3EE" manager_code="1" listed_building="N" status="L" time_stamp="2007-09-26T17:40:08.743" date_created="2007-09-26T17:40:08.743" user_created="PIE" our_file_reference="our_file_reference" ext_file_reference="ext_file_reference" number_postcode="" uri="-2145377861" block_address_1="Tower House" block_address_2="25-32 Bloomsbury Street" block_address_3="LONDON" block_address_4="" block_address_5="WC1B 3EE" block_address_6="UK" block_address_7="" block_address_8="" strung_address="25-32 Bloomsbury Street" main_use_class="A2" sub_use_class="sub_use_class" no_of_floors="0" tenure="tenure" vat_opted="N" via_tramps="N" occupational_status="Occupied" name="Tower House" whole_of_property="N" os_ref="" uprn="0" easting_northing="123456789012" country_code="UK" />
-
</units>
-
<leases>
-
<lease ref="61001" property_ref="6100" unit_ref="1" term_start_date="2000-09-11T00:00:00" term_end_date="2010-09-10T00:00:00" upwards_only_review="Y" review_notice_required="Y" review_basis="" review_pattern="0" continue_after_review="Y" interest_on_late_review="Y" late_review_interest_rate="0.0000" late_review_interest_basis="Above base" time_of_essence_clause="N" outside_1954_act="N" lt_1987_act_applies="N" privity_applies="N" passing_rent="0.00" rent_in_advance="Y" vat_on_rent_applies="No" interest_on_late_rent="N" days_grace_on_late_rent="0" late_rent_interest_rate="0.0000" late_rent_interest_basis="(None)" annual_s_c="12000.00" s_c_charge_type_code="SCO" s_c_due_date_code="MOD" s_c_in_advance="Y" vat_on_s_c_applies="All" interest_on_late_s_c="N" days_grace_on_late_s_c="0" late_s_c_interest_rate="0.0000" late_s_c_interest_basis="(None)" our_file_reference="" ext_file_reference="" breach_status="None" landlord_party_to_lease="Enterprise Properties Limited" tenant_party_to_lease="Kendal Beresford Design Limited" assignment_permitted="" subletting_permitted="" alterations_permitted="" restrictive_covenants="" resp_for_int_repairs="" resp_for_ext_repairs="" resp_for_building_insurance="" resp_for_lor_insurance="" resp_for_pl_insurance="" resp_for_plate_glass_ins="" resp_for_rates="" time_stamp="2003-08-26T12:09:02.660" date_created="2003-08-26T00:00:00" user_created="ADMIN" uri="-2145678987" status="L" s_c_commence_date="2000-09-11T00:00:00" resp_for_int_decs="" int_decs_first_year="0" resp_for_ext_decs="" pre_expiry_review="" undated_option="" undated_option_notice="0" lease_term="" termination_status="Current" late_rent_int_from_due_date="" late_s_c_int_from_due_date="" via_tramps="N" residential_use="" scottish_lease="N" current_tenant_ref="1" current_tenancy_uri="-2145678986" regulated_tenancy="N" registered_rent_pa="0.00" s_c_lease_charge_uri="-2145678984" stay_open_clause="N/A" rent_vat_rate_code="S" s_c_vat_rate_code="S" guarantor=" " change_of_use_permitted="" annual_s_c_adjustable="Y" other_fixed_recoverables="Y" recoverables_vat_rate_code="S" turnover_rent="N" period_rent="0.00" period_s_c="3000.00" late_rent_max_interest_rate="0.0000" late_rent_min_interest_rate="0.0000" late_sc_max_interest_rate="0.0000" late_sc_min_interest_rate="0.0000" late_review_max_interest_rate="0.0000" late_review_min_interest_rate="0.0000" interest_on_late_others="N" days_grace_on_late_others="0" late_others_interest_rate="0.0000" late_others_interest_basis="Above base" late_others_int_from_due_date="" late_others_max_interest_rate="0.0000" late_others_min_interest_rate="0.0000" s_c_apportionment_cap_amount="0.00" default_currency_code="GBP" option_1_type_code="" option_2_type_code="" option_3_type_code="" option_4_type_code="" option_5_type_code="" option_1_by="" option_2_by="" option_3_by="" option_4_by="" option_5_by="" option_1_term="0" option_2_term="0" option_3_term="0" option_4_term="0" option_5_term="0" annual_base_rent_amount="0.00" period_base_rent_amount="0.00" annual_on_account_amount="0.00" period_on_account_amount="0.00" base_rent="N" on_account="N" on_account_type=" " act_2002_applies="N" inclusive_rent="N" />
-
</leases>
-
</property>
Check that x and y have got the correct element by checking the length. See here how yo access DOM nodes.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: El Durango |
last post by:
Hi I have a simple CGI program that takes data from a data source and posts
it
as XML format on the browser, I have tested my program on IE and Mozilla
and they behave differently. Sometimes XML...
|
by: wylbur37 |
last post by:
How do you find out what version of JavaScript your browser supports?
Is there a JavaScript function that will tell you?
__________________________________
Do you Yahoo!?
Find out what made...
|
by: coofucoo |
last post by:
We need to draw a curve with javascript in different browser, like
IE5+, firefox1+, mozilla1.2+.
Is there any existed javascript framework or library we can use?
Thank for your help!
|
by: KC |
last post by:
Hi,
Every JavaScript executive context has a top-level window and
we can use window.open() to open another window ...
Does this related to Windows created by click on "File"->"New Window"
or...
|
by: Jukka K. Korpela |
last post by:
Some time ago in this group, someone suggested that we should develop a
"different" user style sheet to demonstrate what a user style sheet or a
browser style sheet _could_ do. I guess the idea was...
|
by: wpelgrum |
last post by:
When I open a webpage with javascript my browser (both IE6 and
FF2.0.0.3) freezes anywhere from seconds to more than a minute. During
that period, the browser is frozen and windows (XP-SP2) is very...
|
by: sreedhardasi |
last post by:
Hi,
I would like to call a javascript function when user clicks on
browser's close button. Here is the scenario.
1. User clicks browser close button.
2. User will be displayed a popup or a...
|
by: goldenv |
last post by:
Hi all,
I have worked an open source javascript + html page that has the
potential to replace your existing browser home page. If you are
interested in trying it out, or learning more about it, it...
|
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,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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...
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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...
|
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,...
|
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,...
| |