NetTalk Central

Author Topic: Why this code runs on firefox but not on IE8?  (Read 3647 times)

jorgemir

  • Jr. Member
  • **
  • Posts: 71
    • View Profile
    • Email
Why this code runs on firefox but not on IE8?
« on: March 30, 2011, 09:48:52 PM »
Hi.
This is the code I set into the html property of a form, before <form>:

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="content-type" />
<title>PapaNormal</title>
</head>
<body>
<dl>
<dd><big style="color: red;"><big><big><img
style="width: 144px; height: 187px;" alt=""
src="web/images/patatas-fritas.jpg" align="left" />Papas Normales</big></big></big></dd>
<dt><big><big>Papas de primera calidad</big></big></dt>
<dd><big><big>Doraditas y crujientes</big></big></dd>
<dt><big><big>Ración 250gr.</big></big></dt>
<dd><big><big>Te las comerás todas!!!</big></big></dd>
</dl>
<br />
<br />
<big><big><big>Precio: € 2.50</big></big></big>
<hr style="width: 100%; height: 2px;" /><big><big><big>&nbsp;</big></big></big>
</body>
</html>

This run on firefox. On IE8, it freezes the form and does not shows anything. Is there is something bad at xhtml code?
This code is created by the wysiwyg free Kompozer. I wonder if there is any other free html editor better suited for use with NT?

I have the site up now (www.pollonet.es). if you can take a  look I'll appreciate.

Thanks
Jorge
« Last Edit: March 30, 2011, 10:28:30 PM by jorgemir »

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11245
    • View Profile
Re: Why this code runs on firefox but not on IE8?
« Reply #1 on: March 31, 2011, 12:48:13 AM »
Hi Jorge,

This HTML is not an html "snipped" - it's a whole HTML page. It contains am <html> tab, a <head> section, and a <body> section.

The HTML spec does not allow "pages" to be embedded inside other "pages".

In your case you're wanting to embed some html inside the form control, which in turn is placed on a page, so perhaps you can try...

<dl>
<dd><big style="color: red;"><big><big><img
style="width: 144px; height: 187px;" alt=""
src="web/images/patatas-fritas.jpg" align="left" />Papas Normales</big></big></big></dd>
<dt><big><big>Papas de primera calidad</big></big></dt>
<dd><big><big>Doraditas y crujientes</big></big></dd>
<dt><big><big>Ración 250gr.</big></big></dt>
<dd><big><big>Te las comerás todas!!!</big></big></dd>
</dl>
<br />
<br />
<big><big><big>Precio: € 2.50</big></big></big>
<hr style="width: 100%; height: 2px;" />
<big><big><big>&nbsp;</big></big></big>

>> This code is created by the wysiwyg free Kompozer.
>> I wonder if there is any other free html editor better suited for use with NT?

The problem is not so much the wysiwyg designer, but the problem that you're not familiar enough with html to "see" good html from bad. The biggest problem with all these designers is that they do a really bad job with the code.

For example the above code uses the <big> tag, and an embedded style, both "mixing" content with design. Then it uses <dl>, <dt> and <dd> tags - these are definition lists and aren't really the right tags for what you want to do.

The real problem of course is that by "hiding" the code from you, you're not able to learn what good html code looks like. And ultimately this will hurt you. Sure it's a bit more work to learn html, but if you plan to embed custom html then it's worth learning how to do it right.

Once you can tell good html from bad html you're able to not only better choose a visual designer, but you're able to correct the designer when it gets stuff wrong. for example;

<div>
  <img style="width: 144px; height: 187px;" alt=""src="web/images/patatas-fritas.jpg" align="left" />
</div>

<div class="j1"> Papas Normales </div>
<div class="j2">
Papas de primera calidad<br />
Doraditas y crujientes<br />
Ración 250gr.<br />
Te las comerás todas!!!<br />
</div>

<br />
<div class="j3">Precio: € 2.50</div><br />
<hr />

in the styles
.j1 {
    color: red;
    font-size: 2em;
}

.j2 {
    color: green;
    font-size: 1em;
}

.j3 {
    color: blue;
    font-size: 4em;
}

Cheers
Bruce

jorgemir

  • Jr. Member
  • **
  • Posts: 71
    • View Profile
    • Email
Re: Why this code runs on firefox but not on IE8?
« Reply #2 on: March 31, 2011, 10:00:02 PM »
Seems to be easy, but where the styles are? are there into the custom.css? Do NT writes it over when an upgrade is done? What happens when a new version of NT comes and I have some styles developed?
I can do it.
Thanks
Jorge

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11245
    • View Profile
Re: Why this code runs on firefox but not on IE8?
« Reply #3 on: April 01, 2011, 01:53:34 AM »
>> Seems to be easy, but where the styles are?

you put your own styles in your own css file. You don't edit the shipping css files directly.

>>  are there into the custom.css? Do NT writes it over when an upgrade is done?

no, because you give it a name unique to you.

>> What happens when a new version of NT comes and I have some styles developed?

it just works.

I strongly recommend reading the threads in the Share Knowledge forum on CSS for lots of useful information. There's also a link to the ClarionLive webinar there on CSS, and that's pretty much mandatory viewing for NetTalk developers.

http://www.nettalkcentral.com/index.php?option=com_smf&Itemid=36&topic=1765.0

http://www.nettalkcentral.com/index.php?option=com_smf&Itemid=36&topic=116.0
 
Cheers
Bruce