Read XML inside Textarea with Jquery

Asked

Viewed 152 times

0

Good afternoon.

I have a normal HTML page and inside it I have a textearea with an XML of the same page.

As you can see in the image below the XML is inside a textearea. I need to read and use his data with Jquery or JS.

My url looks like this http://meusite.com/pagina

Print

Can Jquery Load help me ? What would be a better alternative to read and use the data from this textarea ?

I’ve searched everything, in several languages, and I couldn’t. If you know a tutorial, or something worth leaving the link.

1 answer

2

I imagine it stays that way:

Source: https://api.jquery.com/jQuery.parseXML/

var xml = $('textAreaSelector').val(),
  xmlDoc = $.parseXML( xml ),
  $xml = $( xmlDoc ),
  $imagem = $xml.find( "imagem" );
  • Sorry, but I am totally Noob in Jquery and JS How do I receive the URL and then do what you said ?

  • Do you want to capture this information from another site? I’m not sure what you need.

  • Sorry, I was unclear. This information is on my site. I want to put the XML part in an APP (android ) with jquery mobile. .

Browser other questions tagged

You are not signed in. Login or sign up in order to post.