I'm using AJAX to open a form page on another site. That site is essentially loaded in its entirety into http.responseText and displayed between a content div.
I have the data stored in a javascript variable, but being somewhat of a n00b at javascript despite being a web developer for nearly 10 years, I'm at a loss as to how to parse it. The data I need is very regular (it's always between "Moonrise" and "Moon transit"). I can do page parsing all day long in PHP using fgets() and a while loop:
The PHP function is fairly trivial to write for a string instead of an external file, but is there a way to pass a Javascript variable storing a string into a PHP variable? It seems needlessly complicated and I would prefer to do the same thing in Javascript, except I don't have a solid understanding of Javascript syntax to pull that off. Any help is appreciated.
~E
I have the data stored in a javascript variable, but being somewhat of a n00b at javascript despite being a web developer for nearly 10 years, I'm at a loss as to how to parse it. The data I need is very regular (it's always between "Moonrise" and "Moon transit"). I can do page parsing all day long in PHP using fgets() and a while loop:
$f = fopen("path/to/file", "r");
while(row = fgets($f, 300))
{
//blah blah blah
}
The PHP function is fairly trivial to write for a string instead of an external file, but is there a way to pass a Javascript variable storing a string into a PHP variable? It seems needlessly complicated and I would prefer to do the same thing in Javascript, except I don't have a solid understanding of Javascript syntax to pull that off. Any help is appreciated.
~E
