Hi,
I created a website and want to make it more efficient. I use spryData for a list with links:
test.html
<a href="#" onclick="fadeIt('apDiv1','kartei/karte_a/karte.html'); return false;">
.
.
.
and now I want to use SpryData also for the karte.html.
<script type="text/javascript">
<!--
var ds_karteikarte = new Spry.Data.HTMLDataSet("karte/karte_a/karte_datenbank.html", "daten_karteikarte", {useCache: false });
//-->
</script>
</head>
<body>
<div id="navigation_karte" class="print">
<p align="left">
<div spry:region="ds_karteikarte">
<table>
<tr spry:repeat="ds_karteikarte">
<td>{Bild}</td>
</tr>
</table>
</div>
Now, when I preview karte.html, all Data ist shown, wenn I review the test.html, only {name} apears in the apDiv1.
What is wrong?
Please help.
Far too many problems within ds_ehf.html. Where is the data supposed to come from?
| anwaelte | anwaelte_IE | anwaelte_de+ep+ra | anwaelte_de+ep+ra_IE | techExperten | techExperten_IE | physik | physik_IE | elektro | elektro_IE | maschinen | maschinen_IE | chemie | chemie_IE | marken | marken_IE | design | design_IE | strategie | strategie_IE | erfinder | erfinder_IE | kanzleileitung | kanzleileitung_IE |
|
|
There is no document declaration (DOCTYPE), no HTML element, no BODY element, the rows do not line up, there are multiple </table>'s without an opening tag.
Clean the code up first and we'll have another look at it.
Gramps
Short answer: it is possible to have a div filled with data as per
But not the way that you are trying. A SpryDataSet obtains its data from various sources such as XML, CSV, JSON and HTML. The data, however, must be presented in a format similar to that of a (SQL) database as per
database
table(s)
record(s)
field(s)
To translate this using an HTML document containing a table with data, the format is
path and name of the document (e.g. myData.html)
table element(s) and id (e.g. <table id="myData">
row element(s) (e.g. <tr>)
cell element(s) (e.g. <td>)
The cell should contain a precise piece of information like firstname, lastname, adress etc. You cannot place a whole series of information into the cell as in
<td width="180" valign="top">
<a href="#" onclick="fadeIt('apDiv1','karteikarten/karte_aaaa/karte.html'); return false;">test</a><br />
<a href="#" onclick="fadeIt('apDiv1','karteikarten/karte_andh/karte.html'); return false;">Andresen, Heiko</a><br />
<a href="#" onclick="fadeIt('apDiv1','karteikarten/karte_aufc/karte.html'); return false;">Aufhauser, Christoph</a><br />
<a href="#" onclick="fadeIt('apDiv1','karteikarten/karte_besm/karte.html'); return false;">Beschnidt, Martin</a><br />
<a href="#" onclick="fadeIt('apDiv1','karteikarten/karte_bram/karte.html'); return false;">Brand, Martin</a><br />
<a href="#" onclick="fadeIt('apDiv1','karteikarten/karte_dros/karte.html'); return false;">Drost, Stephan</a><br />
<a href="#" onclick="fadeIt('apDiv1','karteikarten/karte_eppw/karte.html'); return false;">Epping, Wilhelm</a><br />
<a href="#" onclick="fadeIt('apDiv1','karteikarten/karte_fiss/karte.html'); return false;">Fischer, Siegfried</a><br />
<a href="#" onclick="fadeIt('apDiv1','karteikarten/karte_fisv/karte.html'); return false;">Fischer, Volker</a> <br />
<a href="#" onclick="fadeIt('apDiv1','karteikarten/karte_fuca/karte.html'); return false;">Fuchs, Alexander</a><br />
<a href="#" onclick="fadeIt('apDiv1','karteikarten/karte_graa/karte.html'); return false;">Grammüller, Astrid</a><br/>
<a href="#" onclick="fadeIt('apDiv1','karteikarten/karte_gros/karte.html'); return false;">Gröger, Stephan</a><br />
<a href="#" onclick="fadeIt('apDiv1','karteikarten/karte_hecd/karte.html'); return false;">Heckel, Dieter</a><br />
<a href="#" onclick="fadeIt('apDiv1','karteikarten/karte_heif/karte.html'); return false;">Heidrich, Frank</a><br />
<a href="#" onclick="fadeIt('apDiv1','karteikarten/karte_heru/karte.html'); return false;">Hermann, Uwe</a><br />
<a href="#" class="eng" onclick="fadeIt('apDiv1','karteikarten/karte_hofc/karte.html'); return false;">Hoffmann, Claudia Viktoria</a><br />
<a href="#" onclick="fadeIt('apDiv1','karteikarten/karte_kafv/karte.html'); return false;">Kafka, Veit</a><br />
<a href="#" onclick="fadeIt('apDiv1','karteikarten/karte_kant/karte.html'); return false;">Kanzian, Tanja</a><br />
<a href="#" onclick="fadeIt('apDiv1','karteikarten/karte_ko_h/karte.html'); return false;">Ko, Han Bong</a><br />
<a href="#" onclick="fadeIt('apDiv1','karteikarten/karte_kolf/karte.html'); return false;">Koller, Florian</a><br />
<a href="#" onclick="fadeIt('apDiv1','karteikarten/karte_kuht/karte.html'); return false;">Kuhlmann, Thomas</a><br />
<a href="#" onclick="fadeIt('apDiv1','karteikarten/karte_lamm/karte.html'); return false;">Lambacher, Marion</a><br />
<a href="#" onclick="fadeIt('apDiv1','karteikarten/karte_leic/karte.html'); return false;">Leinung, Christian</a><br />
<a href="#" onclick="fadeIt('apDiv1','karteikarten/karte_letm/karte.html'); return false;">Lettenberger, Michael</a><br />
<a href="#" onclick="fadeIt('apDiv1','karteikarten/karte_liem/karte.html'); return false;">Liebelt, Mechthild</a><br />
<a href="#" onclick="fadeIt('apDiv1','karteikarten/karte_lina/karte.html'); return false;">Lindner, Adrian</a><br />
<a href="#" onclick="fadeIt('apDiv1','karteikarten/karte_linm/karte.html'); return false;">Linhardt, Melanie</a><br />
</td>
In the above, all of the information in the cell will be regarded as one piece of data which should have have the column type set as "html" because of the translation needed for the imbedded markup.
I am not sure what you are trying to achieve, but I do know that you need to start with a basic application and work on from there. A good starting point is here http://labs.adobe.com/technologies/spry/samples/htmldataset/index.html.
Gramps
Hi,
yes this would be a way. But I would have to make a real new structure of the existing website...
Please tell me, if you think following is possible:
This is the code of "http://labs.adobe.com/technologies/spry/samples/utils/update_content.h tml2":
<!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=utf-8" />
<title>Update Content Sample</title>
<script language="javascript" type="text/javascript" src="../../includes/SpryData.js"></script>
<script language="javascript" type="text/javascript" src="../../includes/SpryEffects.js"></script>
<link href="../../css/samples.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript">
function fadeIt(ele,url){
Spry.Effect.DoFade('apDiv1',{ duration: 500, from: 100, to: 0, finish: function() {
Spry.Utils.updateContent(ele, url, function() {
Spry.Effect.DoFade('apDiv1',{ duration: 500, from: 0, to: 100 });
});
}
});
}
</script>
<style type="text/css">
<!--
#apDiv1 {
position: absolute;
left: 1px;
top: 170px;
width: 585px;
z-index: 1;
border: 1px solid #333333;
}
#apDiv1 table {
background-color: white;
}
-->
</style>
</head>
<body onload="Spry.Utils.updateContent('thetext','frags/frag2.html');">
<h3>Spry.Utils.updateContent </h3>
<p><a href="#" onclick="Spry.Utils.updateContent('apDiv1', 'frags/frag1.html'); return false;">Pull in new content</a> | <a href="#" onclick="fadeIt('apDiv1','frags/frag3.html'); return false;">Pull in other new content</a>
</p>
<div id="thetext"></div>
<p> </p>
<div id="apDiv1" class="liveSample">This is old static content.</div>
</body>
</html>
And here is the question: Is it possible to modify frag3.html by inserting Sprydata?
frag3.html ("old" version):
<html xmlns:spry="http://ns.adobe.com/spry"><head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head><body>
<div>
<p>Egypt is the <a href="http://en.wikipedia.org/wiki/Countries_by_population" title="Countries by population">fifteenth most populous country</a> in the world. The vast majority of its 78.8 million population (2006)<a href="http://en.wikipedia.org/wiki/Egypt#_note-Factbook" title="">[1]</a> live near the banks of the <a href="http://en.wikipedia.org/wiki/Nile_River" title="Nile River">Nile River</a> (about 40,000 km² or 15,450 sq miles) where the only <a href="http://en.wikipedia.org/wiki/Arable" title="Arable">arable</a>
agricultural land is found.The regularity and richness of the annual
Nile River flood, coupled with semi-isolation provided by deserts to
the east and west, allowed for the development of one of the world's
great civilizations. <img src="frag3-Dateien/egypt_02.html" alt="Pyramids of Egypt" align="left" hspace="4">A
unified kingdom arose circa 3200 B.C., and a series of dynasties ruled
in Egypt for the next three millennia. The last native dynasty fell to
the Persians in 341 B.C., who in turn were replaced by the Greeks,
Romans, and Byzantines. </p>
</div>
</body></html>
frag3.html ("new" version):
<html xmlns:spry="http://ns.adobe.com/spry"><head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
<script src="frags/SpryAssets/SpryData.js" type="text/javascript"></script>
<script src="frags/SpryAssets/SpryHTMLDataSet.js" type="text/javascript"></script>
<script type="text/javascript">
<!--
var ds2 = new Spry.Data.HTMLDataSet("frags/xxx_datenblatt.html", "dat");
//-->
</script>
</head><body>
<div>
<div spry:region="ds2">
<table>
<tr spry:repeat="ds2">
<td>{column0}</td>
<td>{column1}</td>
<td>{column2}</td>
<td>{column3}</td>
<td>{column4}</td>
<td>{column5}</td>
</tr>
</table>
</div>
</div>
</body></html>
When I do it this way, there is no data shown. Is it possible this way or not?
Please help...
Geli
I forgot...
Here is the code for xxx_datenblatt.html:
<html><head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"></head><body><table width="100%" border="0" id="dat">
<tr>
<td></td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td ><p>It was the Arabs who introduced Islam and the Arabic language in
the 7th century and who ruled for the next six centuries. A local
military caste, the Mamluks took control about 1250 and <img src="frag3-Dateien/egypt_06.html" alt="Pyramids of Egypt" align="right" hspace="4">continued
to govern after the conquest of Egypt by the Ottoman Turks in 1517.
Following the completion of the Suez Canal in 1869, Egypt became an
important world transportation hub, but also fell heavily into debt.</p>
<p> Large areas of land form part of the <a href="http://en.wikipedia.org/wiki/Sahara" title="Sahara">Sahara</a> <a href="http://en.wikipedia.org/wiki/Desert" title="Desert">Desert</a> and are sparsely inhabited. Around half of Egypt's residents live in
urban areas, with the majority spread across the densely populated
centres of greater <a href="http://en.wikipedia.org/wiki/Cairo" title="Cairo">Cairo</a> (the largest city in Africa and the Middle East), <a href="http://en.wikipedia.org/wiki/Alexandria" title="Alexandria">Alexandria</a> and other major towns in the <a href="http://en.wikipedia.org/wiki/Nile_Delta" title="Nile Delta">Nile Delta</a>.</p></td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
</body></html>
Here is the correct link:
http://labs.adobe.com/technologies/spry/samples/utils/update_content.h tml
Sorry!
I uploaded new files on the base of the link above (adobe labs).
www.more-than-design.com/spry_lastTry
So You can see that the data from frag3_sprydata.html is not shown. But when You go to:
www.more-than-design.com/spry_lastTry/frags/frag3_sprydata.html
... , the data will shown correctly.
???
Hi again,
I uploaded an example for my problem :
http://www.more-than-design.com/spry_lastTry
Do somebody know, why the data is not shown, when you click on " frag3sprydata"?
North America
Europe, Middle East and Africa
Asia Pacific