System_ComObject error when sorting with Javascript Gatherer
Posted: Tue Aug 30, 2011 11:18 pm
Your article on Minimal JavaScript for non programmers tutorial, was very informative. But, I don't believe it addressed my issue in sorting the variables.
I am extracting names like this, Doe, John. I need to convert this to John Doe:
My JavaScript gatherer, with limited knowledge on Javascript. And using your built in text-gatherer feature I was able to code this:
With above code I get System_ComObject error.
However, when using :
Instead of:
It works, but only gives me first name.
How do I code this to work , and return John Doe? Or maybe i'm on the wrong track altogether. Or maybe there is a another solution using a different javascript?
I am extracting names like this, Doe, John. I need to convert this to John Doe:
My JavaScript gatherer, with limited knowledge on Javascript. And using your built in text-gatherer feature I was able to code this:
Code: Select all
//returns the first name, using the space as the delimiter
var step0_result = element.innerText.replace(/\r\n/g, "\n");
var step1_slices = step0_result.split(" ");
var step1_result = step1_slices[1];
//returns the last name, using the comma as the delimiter
var step2_result = element.innerText.replace(/\r\n/g, "\n");
var step3_slices = step2_result.split(",");
var step3_result = step3_slices[0];
//Now I need sorted, on the return like so, but this doesn't work
return [step1_result,step3_result];
However, when using :
Code: Select all
return step1_result;
Code: Select all
return [step1_result,step3_result];
How do I code this to work , and return John Doe? Or maybe i'm on the wrong track altogether. Or maybe there is a another solution using a different javascript?