|
|||
![]()
DANKE
also ich versuche nun deine lösung schon mehrer tage und könnte verzweifeln! Mein Ausbilder meinte grad ich soll es mit jquery ajax probieren, das wäre leichter mein xml code, den ich auf mein webspace hochgeladen habe Code:
<?xml version="1.0" encoding="UTF-8"? > <links> <link id="1"> <text>Mozilla</text> <url>http://www.mozilla.com/</url> </link> <link id="2"> <text>Microsoft</text> <url>http://www.microsoft.com/</url> </link> <link id="1"> <text>Opera</text> <url>http://www.opera.com/</url> </link> </links> und das ist mein html code mit der ajax funktion HTML-Code:
$.ajax({ type: 'get', dataType: "text xml", url: 'http://tanzverfuehrung.bplaced.net/filemanager/Test2.xml', crossDomain: true, context: document.body, beforeSend: function() { // before send the request, displays a "Loading..." messaj in the element where the response will be placed $('body').html('Loading...'); }, timeout: 10000, // sets timeout for the request (10 seconds) error: function(xhr, status, error) { alert('Error: '+ xhr.status+ ' - '+ error); }, // alert a message in case of error dataType: 'xml', success: function(response) { $('body').html(''); // removes the "loading..." notification from "#resp" // gets and parse each child element in <webpages> $(response).find('links').children().each(function() { // gets the "id", "title", and "url" of current child element var elm = $(this); var id = elm.attr('id'); var text = elm.find('text').text(); var url = elm.find('url').text(); // displays data $('body').html(id+ ') Text: <b>'+ text+ '</b> -- URL: <b><i>'+ url+ '</i></b><br />'); }); } }); also ich finde der code sieht echt gut aus,soweit! "Loading..." wird dargestellt und es wird auch danach wieder gelöscht aber es wird nichts von der xml ausgegeben! wo liegt mein fehler? |
Sponsored Links |
|
|||
![]() Zitat:
richtig???? meinem server(bzw. mein web space) kann ich aber nicht sagen, welchen header er senden soll,sondern das ist eine voreinstellung oder????? wie kann ich es dann bewältigen???bringt mir da jetzt node.js was, wo ich mir ein eigenen server bauen kann!???? |
|
|||
![]()
so wie auch immer, ich habe es endlich nach tagen hin bekommen
und freue mich grad wie ein kleines kind!!! ![]() ![]() ![]() ![]() ![]() ich danke dir aufjedenfall ganz dolle, du warst mir eine große hilfe.ohne dich wäre ich verzweifelt! ![]() ![]() ![]() ![]() hier mein code: Code:
$.ajax({ type: 'get', dataType: 'xml', url: 'http://tanzverfuehrung.bplaced.net/filemanager/Test3.xml', mimeType: 'application/xml', beforeSend: function() { // before send the request, displays a "Loading..." messag in the element where the response will be placed $('body').html('Loading...'); }, timeout: 10000, // sets timeout for the request (10 seconds) error: function(xhr, status, error) { alert('Error: '+ xhr.status+ ' - '+ error); }, // alert a message in case of error dataType: 'xml', success: function(response) { $('body').html(''); // removes the "loading..." notification from "body" // gets and parse each child element in <links> $(response).find('links').children().each(function() { // gets the "id", "title", and "url" of current child element var elm = $(this); var id = elm.attr('id'); var text = elm.find('text').text(); var url = elm.find('url').text(); // displays data $('body').append(id+ ') Text: <b>'+ text+ '</b> -- URL: <b><i>'+ url+ '</i></b><br />'); }); } }); zu deiner aussage Zitat:
weil in dem punkt habe ich nichts hin bekommen!! oder täusche ich mich da?! ![]() |
|
|||
![]()
Scheint so, dass die SOP dort nicht relevant ist, ja: javascript - Developing Mobile App integrated with Facebook and Twitter using phonegap - Stack Overflow
Offtopic: Es besteht keine Notwendigkeit, Dinge wie Satzzeichen oder Emoticons ständig x-fach zu wiederholen. Nicht böse gemeint. |
![]() |
Stichwörter |
datei laden, phonegap, web, xml |
Themen-Optionen | |
Ansicht | |
|
|
![]() |
||||
Thema | Autor | Forum | Antworten | Letzter Beitrag |
Anfängerfrage: XML Daten in HTML Datei per Ajax ausgeben | mimii | Javascript & Ajax | 5 | 18.08.2011 12:08 |
Daten aus externer XML Datei auslesen und anzeigen....... | RedBaron2104 | (X)HTML | 6 | 10.06.2011 15:36 |
Daten in select-feld laden und selektieren | b74 | Serveradministration und serverseitige Scripte | 19 | 27.11.2009 11:59 |
XML Daten in HTML Tabelle | OvD | (X)HTML | 0 | 21.06.2006 16:24 |
All You Need for Accessibility | Webnauts | Barrierefreiheit | 0 | 29.03.2006 19:07 |