HTML Editor Help

  • 1
  • Question
  • Updated 9 years ago
  • Answered
I've been away from my site for a couple of weeks and started back the other day and started to use the HTML Editor again. I noticed every time I press a key or click the mouse, the editor freezes up for a minutes or two. Were there any changes made to it?
Photo of Adam

Adam

  • 23 Posts
  • 0 Reply Likes
  • confused

Posted 9 years ago

  • 1
Photo of jeremy

jeremy, Employee

  • 1349 Posts
  • 90 Reply Likes
Hi there Adam,

I am sorry you are having this problem. Would you be able to post your URL here so that we can take a look at your site?
Photo of Adam

Adam

  • 23 Posts
  • 0 Reply Likes
I actually found out that invalid HTML code can "break" a webpage.

My code for the webpage that is freezing is here:

<html>
<head>
<script type="text/javascript">
function showHideMe(id){
if(document.getElementById(id).style.display=="none"){
document.getElementById(id).style.display=""
}
else{
document.getElementById(id).style.display="none"
}
}
</script>
<style type="text/css">
.expands{
width:100px;
cursor:hand;
cursor:pointer;
}
</style>
</head>
<body>
<div class="expands" onclick="showHideMe('div1'); showHideMe('div2'); showHideMe('div3');"><b><u>Puzzle Forums</u></b></div>
<div id="div1" style="display:none;">&emsp; &bull; &ensp; <a href='http://twistypuzzles.com/forum'&gt;tw...;
<div id="div2" style="display:none;">&emsp; &bull; &ensp; <a href='http://speedsolving.com/forum'&gt;spe...;
<div id="div3" style="display:none;">&emsp; &bull; &ensp; <a href='http://masterthecube.com/forum'&gt;ma...;
<p></p>
<div class="expands" onclick="showHideMe('div4'); showHideMe('div5'); showHideMe('div6'); showHideMe('div7');"><b><u>Puzzle Shops</u></b></div>
<div id="div4" style="display:none;">&emsp; &bull; &ensp; <a href='http://cubesmith.com/'&gt;cubesmith.c...;
<div id="div5" style="display:none;">&emsp; &bull; &ensp; <a href='http://dr-sticker.com/'&gt;dr-sticker...;
<div id="div6" style="display:none;">&emsp; &bull; &ensp; <a href='http://cube4you.com/'&gt;cube4you.com...;
<div id="div7" style="display:none;">&emsp; &bull; &ensp; <a href='http://mefferts.com/'&gt;mefferts.com...;
</body>
</html>

I don't know if there is anything wrong in here or not. I'm still new to HTML coding. I am wondering if there is a shorter way to hide in the "onclick" area.
Photo of UK Duke

UK Duke, Champion

  • 3321 Posts
  • 213 Reply Likes
Is the page freezing or the html editor?

You could start by removig these, see if that helps.

Also you could try and put the CSS and the javascript code in a seperate html widget at the very top of the page.
Photo of Adam

Adam

  • 23 Posts
  • 0 Reply Likes
I forgot to say that only my links page was freezing, not all of them.

I went to the editor like you said to remove those and place the css and javascript in a separate html widget when I noticed something else. I looked to the right side of the editor to see the scroll bar and it was really tiny. I was able to scroll all the way down and there were 931 blank lines!

I tried to delete some but every time it would freeze up. I made another page and redid all I had on the links page (which really wasn't much at all) on the new page. There isn't any freezing anymore and I've even added a ton more links. The only thing that came to mind when I saw those lines was that I happen to copy and paste alot and sometimes when I paste it adds some blanks lines to the end of all my code.

Also on that code I posted above, it won't let me have more than two words on one line (where you see it being bold and underlined). Why???
Photo of UK Duke

UK Duke, Champion

  • 3321 Posts
  • 213 Reply Likes
so the problems fixed?

If you copy and paste into your site builder you should first paste it into 'Notepad' or another basic text editor (i.e. not WORD etc) This will strip the copied text of any unwanted code.

Lee.

PS. not quite sure sure what you mean about the above code. 2 lines on the site page?
Photo of Adam

Adam

  • 23 Posts
  • 0 Reply Likes
Yes there isn't any more freezing.

Sorry I meant to say when the code is in my page it wont let me have more than two words on the one line. In the code a few post up, the first one says "Puzzle Forums." If you add a third word to that code in your page, the third word will wrap to the next line. I don't know why.
Photo of Sanja

Sanja, Official Rep

  • 10698 Posts
  • 495 Reply Likes
Would you mind posting your site url so that we can take a closer look at what's happening?
Photo of Adam

Adam

  • 23 Posts
  • 0 Reply Likes
Here

You'll see the first line. It should all be on one line and for some reason it's not. I'm sorry I kept saying that only two words could be on one line. Only a certain amount of characters can be on one line.

Edit: I just figured it out. Change the 100px in the css to something like 200px and that will fix it.
Photo of Sanja

Sanja, Official Rep

  • 10698 Posts
  • 495 Reply Likes
The reason why this is happening is because the width is set only for 100px.

You'll need to find this code:
<style type="text/css">.expands{width:100px;cursor:hand;cursor:pointer;}</style></div></div><div id="I22" style="display:block;clear: both;" class="HTML_Default"><div id="I22_html"><div class="expands" onclick="showHideMe('div1')"><b><u>Test One Two Three Four</u></b></div>
<div id="div1" style="display:none;">

Change the width:100px to a higher number such as 400px or you can change it to width:100% this will change dynamically on the column size you use.

Please let me know if you need further clarification.
Photo of Adam

Adam

  • 23 Posts
  • 0 Reply Likes
Thank you guys! You all have been a big help!