Click here to get back home

How does this work? (CDATA)

 HomeNewsGroups | Search | About
 comp.infosystems.www.authoring.html    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
How does this work? (CDATA) test9991014 05-06-2008
Posted by test9991014 on May 6, 2008, 3:51 pm
Please log in for more thread options
While visiting the apple.com page, I noticed an unusual
form behavior that seems pretty nice, but looking at the
source (below) it is unclear how it works. Is there a tutorial
that explains it? Thanks.

<div id="ppu-checker">
<form id="ppu-check-form" onsubmit="return false;" method="get"
action="http
://store.apple.com/1-800-MY-APPLE/WebObjects/AppleStore.woa/wa/RSLID">
<p>
</p><div id="ppu-input-container" class="psearch
nonsafari"><label><
input name="ppu-postal-code" maxlength="" size="10" class="psearch
nonsafari" va
lue="Zip code" id="ppu-postal-code" type="text"><span id="ppu-input-
container-re
set"></span></label></div>
<script type="text/javascript">
// <![CDATA[
dojo.require("apple.widget.PrettySearchField");
var ppuinputcontainerObj = new apple.widget.PrettySearchField(
{
inputId: "ppu-postal-code",
containerId: "ppu-input-container",
resetIconId: "ppu-input-container-reset",
maxLength: "5",
results: "",
placeholder: "Zip code",
autosave: ""
}
);
// ]]>
</script>

Posted by sheldonlg on May 6, 2008, 4:35 pm
Please log in for more thread options
test9991014@yahoo.com wrote:
> While visiting the apple.com page, I noticed an unusual
> form behavior that seems pretty nice, but looking at the
> source (below) it is unclear how it works. Is there a tutorial
> that explains it? Thanks.
>
> <div id="ppu-checker">
> <form id="ppu-check-form" onsubmit="return false;" method="get"
> action="http
> ://store.apple.com/1-800-MY-APPLE/WebObjects/AppleStore.woa/wa/RSLID">
> <p>
> </p><div id="ppu-input-container" class="psearch
> nonsafari"><label><
> input name="ppu-postal-code" maxlength="" size="10" class="psearch
> nonsafari" va
> lue="Zip code" id="ppu-postal-code" type="text"><span id="ppu-input-
> container-re
> set"></span></label></div>
> <script type="text/javascript">
> // <![CDATA[
> dojo.require("apple.widget.PrettySearchField");
> var ppuinputcontainerObj = new apple.widget.PrettySearchField(
> {
> inputId: "ppu-postal-code",
> containerId: "ppu-input-container",
> resetIconId: "ppu-input-container-reset",
> maxLength: "5",
> results: "",
> placeholder: "Zip code",
> autosave: ""
> }
> );
> // ]]>
> </script>

The CDATA lines have been commented out.

Posted by David Stone on May 6, 2008, 5:34 pm
Please log in for more thread options
sheldonlg <sheldonlg> wrote:

> test9991014@yahoo.com wrote:
> > While visiting the apple.com page, I noticed an unusual
> > form behavior that seems pretty nice, but looking at the
> > source (below) it is unclear how it works. Is there a tutorial
> > that explains it? Thanks.
> >
> > <div id="ppu-checker">
> > <form id="ppu-check-form" onsubmit="return false;" method="get"
> > action="http
> > ://store.apple.com/1-800-MY-APPLE/WebObjects/AppleStore.woa/wa/RSLID">
> > <p>
> > </p><div id="ppu-input-container" class="psearch
> > nonsafari"><label><
> > input name="ppu-postal-code" maxlength="" size="10" class="psearch
> > nonsafari" va
> > lue="Zip code" id="ppu-postal-code" type="text"><span id="ppu-input-
> > container-re
> > set"></span></label></div>
> > <script type="text/javascript">
> > // <![CDATA[
> > dojo.require("apple.widget.PrettySearchField");
> > var ppuinputcontainerObj = new apple.widget.PrettySearchField(
> > {
> > inputId: "ppu-postal-code",
> > containerId: "ppu-input-container",
> > resetIconId: "ppu-input-container-reset",
> > maxLength: "5",
> > results: "",
> > placeholder: "Zip code",
> > autosave: ""
> > }
> > );
> > // ]]>
> > </script>
>
> The CDATA lines have been commented out.

It may be a WebObjects thing? Not sure, as I've never actually
poked into WebObjects, but Apple certainly has...

Posted by Gus Richter on May 6, 2008, 7:40 pm
Please log in for more thread options
David Stone wrote:
> sheldonlg <sheldonlg> wrote:
>
>> test9991014@yahoo.com wrote:
>>> While visiting the apple.com page, I noticed an unusual
>>> form behavior that seems pretty nice, but looking at the
>>> source (below) it is unclear how it works. Is there a tutorial
>>> that explains it? Thanks.
>>>
>>> <div id="ppu-checker">
>>> <form id="ppu-check-form" onsubmit="return false;" method="get"
>>> action="http
>>> ://store.apple.com/1-800-MY-APPLE/WebObjects/AppleStore.woa/wa/RSLID">
>>> <p>
>>> </p><div id="ppu-input-container" class="psearch
>>> nonsafari"><label><
>>> input name="ppu-postal-code" maxlength="" size="10" class="psearch
>>> nonsafari" va
>>> lue="Zip code" id="ppu-postal-code" type="text"><span id="ppu-input-
>>> container-re
>>> set"></span></label></div>
>>> <script type="text/javascript">
>>> // <![CDATA[
>>> dojo.require("apple.widget.PrettySearchField");
>>> var ppuinputcontainerObj = new apple.widget.PrettySearchField(
>>> {
>>> inputId: "ppu-postal-code",
>>> containerId: "ppu-input-container",
>>> resetIconId: "ppu-input-container-reset",
>>> maxLength: "5",
>>> results: "",
>>> placeholder: "Zip code",
>>> autosave: ""
>>> }
>>> );
>>> // ]]>
>>> </script>
>> The CDATA lines have been commented out.
>
> It may be a WebObjects thing? Not sure, as I've never actually
> poked into WebObjects, but Apple certainly has...

In XHTML, Script and Style element contents must be wrapped within a
CDATA marked section to avoid expansion of entities < and & as start of
markup and not to recognize &lt; and &amp; as < and & respectively. i.e.

<script>
<![CDATA[
... unescaped script content ...
]]>
</script>

The (//) are javascript single line comments - the CDATA start and end
tags are required for XHTML, but javascript will not see those lines.

--
Gus

Posted by Stefan Ram on May 6, 2008, 7:47 pm
Please log in for more thread options
>In XHTML, Script and Style element contents must be wrapped within a
>CDATA marked section to avoid expansion of entities < and & as start of

These characters can also be encoded by other
well-known means without »CDATA«.


Similar ThreadsPosted
Would UBB thread work for this? March 9, 2006, 2:13 pm
How to get MAP to work with mouseover April 10, 2006, 10:59 pm
CSS positioning: why does this work? May 15, 2006, 2:12 pm
favicon doesn't work in IE6 October 8, 2006, 11:48 pm
This work on your browser? January 8, 2007, 1:27 am
Does my menu work in IE7? March 29, 2007, 9:51 am
Why didn't the include work? April 6, 2007, 8:12 am
2nd List Doesn't Work March 30, 2008, 11:34 pm
Re: Why this html doesn't work? May 26, 2008, 1:38 am
window.open(...) does not work September 9, 2004, 12:28 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap