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 866061
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T09:44:29+00:00 2026-05-15T09:44:29+00:00

I would like to retrieve fullpath of a file and pass it to javascript.

  • 0

I would like to retrieve fullpath of a file and pass it to javascript. The requirement is that I need to retrieve XML file using JavaScript.

  • 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-05-15T09:44:30+00:00Added an answer on May 15, 2026 at 9:44 am

    If it is a file you can access relatively to your web page do something like:

    var xmlDoc=new ActiveXObject("MSXML.DOMDocument");
    xmlDoc.async="false";
    xmlDoc.load("abc.xml"); 
    

    Assuming you have your web page next to the abc.xml…

    This doesn’t specify how to get full path to the XML – do youi still need it or loading it is enough?

    For cross browser (from: http://developer.apple.com/internet/webcontent/xmlhttpreq.html)

    var req;
    loadXMLDoc("abc.xml");
    
    function loadXMLDoc(url) {
        req = false;
        // branch for native XMLHttpRequest object
        if(window.XMLHttpRequest && !(window.ActiveXObject)) {
        try {
                    req = new XMLHttpRequest();
                } catch(e) {
                    req = false;
                }
            // branch for IE/Windows ActiveX version
            } else if(window.ActiveXObject) {
                try {
                    req = new ActiveXObject("Msxml2.XMLHTTP");
                } catch(e) {
                    try {
                        req = new ActiveXObject("Microsoft.XMLHTTP");
                    } catch(e) {
                        req = false;
                    }
                }
            }
            if(req) {
                req.onreadystatechange = processReqChange;
                req.open("GET", url, true);
                req.send("");
            }
        }
    
        function processReqChange() {
            // only if req shows "loaded"
            if (req.readyState == 4) {
                // only if "OK"
                if (req.status == 200) {
                    // ...processing statements go here...
                    alert(req.responseXML);
                } else {
                    alert("There was a problem retrieving the XML data:\n" + req.statusText);
                }
            }
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to retrieve a random word from a file using python, but
I would like to know if it's possible to retrieve the .cs file that
Using ClearCase, I would like to retrieve all the elements of the VOB that
I would like to retrieve the ethernet address of the network interface that is
I would like to retrieve the AppSetting key from the assembly config file called:
I would like to retrieve the contents of a file, filter and modify them
I would like to retrieve an ordered query result, but I need to have
I would like to retrieve the cpu and ram usage at that point for
I would like to retrieve articles that are within 1 year from the today's
I would like to retrieve an error message that explains why the jvm failed

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.