Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9165777
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T14:59:08+00:00 2026-06-17T14:59:08+00:00

I search for a method to get plain xml(with tags ect.) from a file

  • 0

I search for a method to get plain xml(with tags ect.) from a file and save it so the localStorage.

I found a few opportunities, but every one of them returns the xml without tags. I prefer jQuery to do this…

I tried $.get, $("").load() and AJAX but I don’t get it. I just want to save the whole xml as string into the localStorage and read it out later (and work with it).

Does anyone have a idea?

Regards

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T14:59:10+00:00Added an answer on June 17, 2026 at 2:59 pm

    You can use:

    $.ajax({
       url: 'http://example.com',
       dataType: 'text',
       success: function (data) {
          localStorage.setItem('xml-content', data);
       }
    });
    

    This will provide you the XML document as plain text and save it to the localStorage.

    Here is a full solution:

    <!DOCTYPE html>
    <html>
    <head>
    </head>
    <body>
    <pre id="output">
    </pre>
    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
    <script>
        function setXML() {
            $.ajax({
               url: 'test.xml',
               dataType: 'text',
               success: function (data) {
                  localStorage.setItem('xml-content', data);
                  getXML();
               }
            });
        }
        function getXML() {
            var xml = localStorage.getItem('xml-content');
            $('#output').text(xml);
        }
        setXML();
    </script>
    
    </body>
    </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm a little surprised the behavior of Twitter's search get method. Few weeks ago
i was wondering why does <%= form_tag( { :action => /search, :method => get
I have implemented the search method for a UITableView populate from a NSArray (mylist):
I want to make a search method from a list of Restaurants. The user
I have a SearchService with a Search() method that retrieves an IEnumerable<Search> from a
I am trying to construct search method by accepting some keywords as a GET
Page not found (404) Request Method: GET Request URL: http://beta.mysite.com/admin/filebrowser/ The requested admin page
I am trying to read/update/delete the XML file on the basis of value found.
I'm practicing coding jQuery and Ajax and making a plain Google search box, but
I have this form: <%= form_tag posts_path, :method => :get, :class => search_nav do

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.