Ahhh this is a common issue. When you're working in smartEdit RedDot
looks for the <body> tag so it can place some reddot code in there
for the dots. If it can't find the body tag, it helpfully adds it for
you as it adds in it's own code... instantly invalidating your code
and causing all sorts of errors to appear. This will also be happening
to your stylesheets; it just won't be as apparent.
There are a couple of options to work around this :
1) In your JS files make the first line /* <body></body> */ . This
gives RedDot somewhere to put it's script so it doesn't break your
project.
or
2) In your link you can add a little bit of extra code so it looks
like <script src="file.js<!IoRangeRedDotMode>&script=1</!
IoRangeRedDotMode>" type="text/javascript"></script> This is supposed
to tell RedDot to not append anything into the script file, but we've
seen it cause other issues, especially when switching between
smartEdit and smartTree.
Finally the best option that we've come across...
3) In addition to your anchor you can set up a container in your
template. Reference the container to your anchor so that the contents
of your JS file appears in the container. Hide the container outside
of RedDot and hide the anchor inside smartEdit so that it looks
something like this :
<!IoRangeNoRedDotMode>
<script src="file.js" type="text/javascript"></script>
</!IoRangeNoRedDotMode>
<!IoRangeRedDotMode>
<%cnt_javascript%>
</!IoRangeRedDotMode>
This has a double benefit. Your pages will no longer cause errors in
smartEdit and you should also see a slight speed improvement for the
editors as RedDot will be rendering one page instead of two each time
a page is loaded.