Skip to main content
Participating Frequently
January 12, 2007
Question

Dreamweaver Changes Code

  • January 12, 2007
  • 4 replies
  • 584 views
Mutter mutter!

Absolutely horrified - DW8.0.2 appears to act like a Microsoft product and changes code on opening.

I have recently become aware that after having corrected every fine detail to meet W3C validation - including changing from
<body onLoad=
to
<body onload=

to comply . Just fine!

Now whenever I return to open that same file to modify content only - DW has reverted my code to <body onLoad=.

I thought only FrontPage did that. YUK!

Check it out here at one of my clients sites.
www.arkits.com/index.php

I am using the following DocType:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns=" http://www.w3.org/1999/xhtml">

My Preferences :
Under Code Rewriting I have the following "set"
- Remove extra closing tags
- Warn when fixing or removing tags
- Never rewrite code with default extensions -.as .asr .asc .asp .ascx .asmx .aspx .cfc .cfm .cfml .config .cs .ihtml .js .jsp .php .php3 .vb .xml .xsl .xslt .xul

- Special characters
- both active content - insert and convert

Can someone please explain and tell me what property setting would stop same - or is there a workaround.?

Thanks in anticipation

John
This topic has been closed for replies.

4 replies

Inspiring
January 24, 2007
Good luck....

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================


"AceTutor_Warwick" <webforumsuser@macromedia.com> wrote in message
news:ep7mvo$42$1@forums.macromedia.com...
> Apologies for the delay in reply.
>
> Murray (ACE) - thanks for the explanation. Yes indeed I had <html>,
> <head>,
> and <body> inside and include files. It seems to work fine - except when
> DW
> reloaded the page.
>
> David Powers - thanks for your comment - I will change my practise of
> hiding
> the DOCTYPE in includes in future.
>
> Thank you both for your patience
>
> Much appreciated.
>
>
>


Participating Frequently
January 24, 2007
Apologies for the delay in reply.

Murray (ACE) - thanks for the explanation. Yes indeed I had <html>, <head>, and <body> inside and include files. It seems to work fine - except when DW reloaded the page.

David Powers - thanks for your comment - I will change my practise of hiding the DOCTYPE in includes in future.

Thank you both for your patience

Much appreciated.

Participating Frequently
January 24, 2007
Apologies for the delay in reply.

Murray (ACE) - thanks for the explanation. Yes indeed I had <html>, <head>, and <body> inside and include files. It seems to work fine - except when DW reloaded the page.

David Powers - thanks for your comment - I will change my practise of hiding the DOCTYPE in includes in future.

Thank you both for your patience

Much appreciated.

Inspiring
January 12, 2007
I have this page -

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
" http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns=" http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<meta http-equiv="imagetoolbar" content="no" />
<meta name="MSSmartTagsPreventParsing" content="TRUE" />
<meta name="robots" content="index,follow" />
</head>

<body onload="foo()">
<p>This is a test</p>
<p>of a page </p>
</body>
</html>

I save it. Close it. Reopen it. The code remains the same. My
Preferences are quite ordinary. So, I cannot reproduce your complaint.

And for what it's worth, your Microsoft rant is misplaced here.

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================


"AceTutor_Warwick" <webforumsuser@macromedia.com> wrote in message
news:eo6s9h$m0f$1@forums.macromedia.com...
> Mutter mutter!
>
> Absolutely horrified - DW8.0.2 appears to act like a Microsoft product and
> changes code on opening.
>
> I have recently become aware that after having corrected every fine detail
> to
> meet W3C validation - including changing from
> <body onLoad=
> to
> <body onload=
>
> to comply . Just fine!
>
> Now whenever I return to open that same file to modify content only - DW
> has
> reverted my code to <body onLoad=.
>
> I thought only FrontPage did that. YUK!
>
> Check it out here at one of my clients sites.
> www.arkits.com/index.php
>
> I am using the following DocType:
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
> " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> <html xmlns=" http://www.w3.org/1999/xhtml">
>
> My Preferences :
> Under Code Rewriting I have the following "set"
> - Remove extra closing tags
> - Warn when fixing or removing tags
> - Never rewrite code with default extensions -.as .asr .asc .asp .ascx
> .asmx
> .aspx .cfc .cfm .cfml .config .cs .ihtml .js .jsp .php .php3 .vb .xml .xsl
> .xslt .xul
>
> - Special characters
> - both active content - insert and convert
>
> Can someone please explain and tell me what property setting would stop
> same -
> or is there a workaround.?
>
> Thanks in anticipation
>
> John
>
>


Participating Frequently
January 13, 2007
Thank you Murray (ACE) for your response.

Firstly - my apology for bagging Microsoft. In a previous life I used Front Page and the big bleat in those days was the "wonderful ability" of FP to change your code for you. I was suspecting DW might have the same characteristics.


I believe I have found what is my problem - and would appreciate your further comments. Using your code I will - hopefully demonstrate what I have discovered.

1. Your code works perfectly - does not change onload on opening.
2. I then copied your "head area" to a seperate file and saved it as head.php in my includes folder.
3. I then deleted the same code from your code and replaced it with a Server Side include.
4. I tested the file - it appeared to produce the same code. Saved the file with lowercase onload.
5. On reopening your code - onload was now onLoad.

Leaving the DocType out of the include avoid my drama. Why - I don't know and would appreciate your valued comments.

Thanks again

John (alias AceTutor)


..................................................................................................................

My code:
Code for DW_Test.php:

<?php require_once('includes/head.php'); ?>
<body onLoad="foo()">
<p>This is a test</p>
<p>of a page </p>
</body>
</html>

Code for head.php in the include folder:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
" http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns=" http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<meta http-equiv="imagetoolbar" content="no" />
<meta name="MSSmartTagsPreventParsing" content="TRUE" />
<meta name="robots" content="index,follow" />
</head>