473,594 Members | 2,768 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Safari DOM not resetting when layer changed

I believe I've found a problem with the Safari DOM when updating the
text found within a layer. Although the layer is updated correctly
visually, the underlying DOM seems to grow larger with duplicated
elements rather than being reset with the new elements. I've created a
test page which demonstrates this issue...

http://www.qas.com/layer-test.htm

The page contains an initially empty <div> element within <form> tags.
When the page loads the div is populated with an input field and a
button using Dreamweaver's MM_setTextOfLay er function. The action on
the button is to update the div with some new form elements and alert
the form collection. The updated div contains a button which sets the
div back to its original state and again alerts the form collection.
This does exactly what you expect in IE, Firefox, NS6+, Opera, with
just the form elements visible on the page being alerted, but in Safari
the form collection just keeps growing as you move back and forth using
the buttons.

Is there another way to do this in Safari or is a bug with the program?

Thanks in advance for any help!

Tim

Jul 23 '05 #1
1 1639
ti******@gmail. com wrote:
I believe I've found a problem with the Safari DOM when updating the
text found within a layer. Although the layer is updated correctly
visually, the underlying DOM seems to grow larger with duplicated
elements rather than being reset with the new elements. I've created a
test page which demonstrates this issue...

http://www.qas.com/layer-test.htm

The page contains an initially empty <div> element within <form> tags.
When the page loads the div is populated with an input field and a
button using Dreamweaver's MM_setTextOfLay er function. The action on
the button is to update the div with some new form elements and alert
the form collection. The updated div contains a button which sets the
div back to its original state and again alerts the form collection.
This does exactly what you expect in IE, Firefox, NS6+, Opera, with
just the form elements visible on the page being alerted, but in Safari
the form collection just keeps growing as you move back and forth using
the buttons.

Is there another way to do this in Safari or is a bug with the program?


I'd like to blame that dreadful MM_ code, or innerHTML, but it is a
bug with Safari that removed form elements aren't really removed.

<URL:http://www.quirksmode. org/bugreports/archives/2004/11/safari_and_docu .html>

other Safari bugs are listed at Quirksmode here:

<URL:http://www.quirksmode. org/bugreports/archives/safari/>

Here's a simple test script:

<form action="">
<input type="text" name="num" width="30"><br>
<input type="button" value="Add a button" onclick="
var oInp = document.create Element('input' );
oInp.type = 'button';
oInp.value = 'Delete me';
oInp.onclick = function() {
this.form.remov eChild(this);
}
this.form.appen dChild(oInp);
this.form.num.v alue='There are '
+ this.form.eleme nts.length + ' elements';
">
</form>

I'd suggest re-writing that awful MM_ stuff to be cleaner and leaner
and replace innerHTML with DOM.

Get rid of the " /* <![CDATA[ */ " comment delimiters inside the
script element - your doctype is HTML and therefore they aren't
required at all. Similarly, the use of " />" indicates XHTML, but
your doctype is HTML.


--
Rob
Jul 23 '05 #2

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

Similar topics

1
1925
by: liberty | last post by:
Hi, I have looked everywhere to try and solve my problem-- looked at W3C DOM Compatibility charts, read articles, tried debuggers, and still my script is not working. The problem I have is this. I am working on a script that dynamically generates maps with research sites that show up when selected from a pulldown list. The sites show up in every browser except for Safari, and I can't figure out why. I have made a simple function that...
4
1548
by: Pasquale | last post by:
With the code below, can anyone see why the array and/or the field in the last line are empty for Safari users? It works with Netscape 6 and up, IE 6, Firefox, Konqueror. Thanks, Pasquale //begin
2
1246
by: Lau Lei Cheong | last post by:
This is to be refered to my many-months-ago previous most on "mercyful browers". It just seems that both IE and Firefox are "too merciful" to web development testing. There's a sample code to be run on "onclick" event of checkbox that has been hidden in our code 1 year, and go pass the QC by both IE and Firefox without complain:
5
1782
by: jmdocherty | last post by:
All, I've been trying to set up a CSS layout and all seems well in Firefox but in Safari it just seems to be plain weird! I hope someone can help tell me whether this is a problem with my code or a Safari oddity (which if it is, any top-tips to fix it would be most welcome!). Objective: I want to have the meat of the viewport divided into 3 columns (a fixed margin (say 140px) and 2 scalable panes on the right each of which
4
4071
by: Ian Davies | last post by:
Hello I am struggling for a solution to clear some fields on my webpage that takes their values from some sessions My solution below works when the button is clicked twice. I sort of know why I have to click it twice to do the job (the first submit resets the sessions but this it too late to change the field values, which requires another submit to pick up the new session values). Problem is I cant think how to accomplish the resetting of...
12
2058
by: effendi | last post by:
I wrote the following function and tested it in MSIE, Firefox and Mac Safari, Works in all but the Safari. What can I do to rectify this? function processBackground(){ for (n=1;n<11;n++) { cellrow="r"+n for (i=1;i<17;i++){ cell=cellrow+"w"+i cellName=cell+"_ID"
11
6093
by: J_Zanetti | last post by:
Hello everybody, In my applications I've a ton of scripts that use remote XML file to fill forms and evaluate contents; In these scripts I always use the method SelectNode (that, with some workaround, works fine also in Mozilla). I've just found out that this method doesnt work in Safari browser, therefore my applications are not usable by this browser. Can anyone provide me any solution or workaround to be able to read XML files in...
3
2471
by: dd | last post by:
Hi, I have some code that hides all Flash objects on a page. It's working fine on IE and Gecko but doesn't work on Safari. There are no errors (shown in the console) when it runs on Safari, and when I alert the properties they do show the correctly changed status, but the screen doesn't reflect that. It maybe a bug in the Flash player for Safari (I'm using player 9.0) which is just ignoring that it's been hidden. Here is the...
2
2737
by: JDeats | last post by:
>From my development envrionment (i.e. a single WinXP notebook PC) I have a basic AJAX application that is making the call to a Windows Form page that just returns the request back to the AJAX client from the JavaScript HttpXMLRequest protected void Page_Load(object sender, EventArgs e) { string txt = ""; string input = null;
0
7937
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8368
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...
0
8230
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
5738
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
5403
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
3893
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2383
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
1
1471
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1204
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.