This question has been asked more then once, but somehow I don t get things to work. I am struggling with this problem for some hours now already.
I got a xml file:
<?xml version="1.0" encoding="iso-8859-1"?>
<news>
<field id="nettooppervlakte1">
<name>Opp. netto</name>
<content>970</content>
<background>1</background>
</field>
<field id="nettooppervlakte2">
<name>Ras 1</name>
<content>Euro sunny</content>
<background>1</background>
</field>
<field id="nettooppervlakte3">
<name>Plantdichtheid 1 (st/m²)</name>
<content>45</content>
<background>1</background>
</field>
</news>
xml文档是较大的,但无需填上整个档案(更多的领域)。
然后,我用在html(文字)中来获取信息:
$(document).ready(function(){
var id = 0;
$.ajax({
type: "GET",
url:"http://www.officespecialisten.it/wesleyfloor/table.xml",
dataType: "xml",
success: function(xml) {
$(xml).find( field ).each(function(){
var name = $(this).find( name ).text();
var content = $(this).find( content ).text();
var days = $(this).find( days ).text();
var day = $(this).find( day ).text();
var week = $(this).find( week ).text();
var year = $(this).find( year ).text();
$( <div class="items" id="link_ +"nettooppervlakte"+id+ "></div> +id++).html(name+ </a> ).appendTo( # +id+ name );
$( <div class="items" id="link_ +"nettooppervlakte"+id+ "></div> ).html(content+ </a> ).appendTo( # +id+ content );
$( <div class="items" id="link_ +"nettooppervlakte"+id+ "></div> ).html(days+ </a> ).appendTo( # +id+ days );
$( <div class="items" id="link_ +"nettooppervlakte"+id+ "></div> ).html(day+ </a> ).appendTo( # +id+ day );
$( <div class="items" id="link_ +"nettooppervlakte"+id+ "></div> ).html(week+ </a> ).appendTo( # +id+ week );
$( <div class="items" id="link_ +"nettooppervlakte"+id+ "></div> ).html(year+ </a> ).appendTo( # +id+ year );
});
}
});
});
并将其列入表(html):
<tr>
<td colspan="2" bgcolor="#ade500"><div id="1name"></div></td>
<td colspan="2" bgcolor="#ade500"><div id="1content"></td>
</tr>
<tr>
<td colspan="2" bgcolor="#ade500"><div id="2name"></div></td>
<td width="2" bgcolor="#ffffcc"><div id="2content"> </td>
</tr>
<tr>
<td colspan="2" bgcolor="#ade500"><div id="3name"></div></td>
<td colspan="2" bgcolor="#ffffcc" ><div id="3content"></div></td>
</tr>
And now the problem, I want that the user can change (with a input box or something) the value of (for example) "3content":
<td colspan="2" bgcolor="#ffffcc" ><div id="3content"></div></td>
1. 本轴线:
<content>45</content>
这样做是否容易? 由于我看到/推测了一些长页的法典(d试着它们全部),以改变1XML的价值,我认为,问题很多。
我正处在超文本/XML的开始阶段。 我使用的是roid、行动说明3、c++(主要是与CML图书馆)。 我还建立了我的第一个真正网站。
如果你们需要了解更多的事情或对一些事情的解释,那么就应该问。
感谢你的耐心,
散 动