Это видео недоступно.
Сожалеем об этом.
JavaScript Tip: Loading an External XML File
HTML-код
- Опубликовано: 14 авг 2024
- If you need access to XML data and it is stored in an external XML file, you will need to load it. In this tutorial we use the XML HttpRequest object to load an external XML file. This tutorial is a follow up to a previous tutorial on working with XML data: • JavaScript Question: H...
For more resources on JavaScript:
www.allthingsja...
Access to EVERY course (get 2 months free): www.skillshare...
Courses offered on Udemy at a discount:
Getting Started: www.udemy.com/...
Advanced Topics: www.udemy.com/...
Mastering Regular Expressions in JavaScript:
www.udemy.com/...
Functional Programming in JavaScript: www.udemy.com/...
NEW Mastering JavaScript Arrays: www.udemy.com/...
Tutorials referred to in this video:
Working with XML Data: • JavaScript Question: H...
Callbacks: • Understanding JavaScri...
Excelllent
Great video explaining things slowly!
I have a xml file which I upload it through a button. I want to convert the data of it into a editable one (I want to find and replace automatically some strings in it). What should I do, which method should I use? Looking forward to your response.
When you load an XML file it becomes a string. So you can replace anything in the string. The difficult part is writing it out to the hard drive. If you are sending it back to a server, no problem. But you won't be able to write to the hard drive with just JavaScript for security reasons.
@@AllThingsJavaScript thanks very much for your reply. And yes, the only thing I don't know is how to save the changes back to file :((
@@trananhome It must be done with an application, or on a server. Setting up a server with node would do it.
thank you, very helpful
make a video about unit testing and e2e testing
hello, I have to display on a web page my contents of my xml file by doing a parser. But my javascript code does not work and nothing is displayed. could you help me? thank you in advance
Post your code and any errors you are getting.
@@AllThingsJavaScript
fichier html:
Application API
Application API
Accueil
JSON
XML
Tests API avec JSON/XML
$.getJSON( "/home/damien/lappstack-7.1.27-1/apache2/htdocs/Projettut2/xml.json", function( data ) {
var items = [];
$.each( data, function( key, val ) {
items.push( "" + val.title + "" );
});
$( "", {
"class": "my-new-list",
html: items.join( "" )
}).appendTo( "body" );
});
Fichier xml:
Lemaire
Pierre
245
Rue Victor Hugo
60750
Choisy-au-bac
FRANCE
03 44 85 97 32
06 20 92 31 80
Plemaire770@gmail.com
Bodin
Damien
7
Rue des treilles
62400
Béthune
France
0782905065
damien.bodin07@gmail.com
explain:
in the hml file I have to make a java script in the tag to read on the html page the data of the xml file.
the script that is on the html file does not work because it is for my json file and in fact I have to do the same for the xml file and nothing works because I tried a lot of other script
It looks like you are using jQuery for this. So what type of response are you getting? Do you receive an error? If no error, check the data variable of the function and see if you receive any thing in it. That will help narrow down where the problem is. That is the first step.
Is it not possible to load in an external XML file without making HTTP requests?
You can use fetch: ruclips.net/p/PLTo9PCskHpbGVLVtW0XBUVbfeqT5r-SBh
You can also use a JavaScript library, but it will do this kind of thing on the backend.
Thanx
You could get more visits if you change your title adding in for newbies.
Which title?
why not use a quiet keyboard.
I guess I just haven't purchased one yet.
it adds to the ambience
Goooosh, this video feels like you are at school..... So slow filled with unnecessary introductions like you are in a theory class... the interesting part start at 4:29
Perfect for newbies