Getting a specific tag in file . ofx

Asked

Viewed 164 times

0

I can read the whole . ofx file with javascript / ajax:

var ofxReader = new XMLHttpRequest() || new ActiveXObject('MSXML2.XMLHTTP');

function loadFile() {
    ofxReader.open('get', 'sample.ofx', true); 
    ofxReader.onreadystatechange = displayContents;
    ofxReader.send(null);
}

function displayContents() {
    if(ofxReader.readyState==4) {
        var el = document.getElementById('main');
        var list = ofxReader.responseText;
        el.innerHTML = list;
    }
}

loadFile();

However, I only wanted to get a specific tag(MEMO, TRNAMT, for example) so I could format.

  • Want to change html or a string? and you can give an example of how the file content is?

  • Hello, Sergio! Sorry for the delay. I found out how: instead of responseText, used the responseXML even. So I walked with a for and I was able to use the getElementsByTagName.

No answers

Browser other questions tagged

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