Why are you making XHRs w/ the proprietary activeX syntax?  There is
your first problem, adopt Ajax.Request for any and all XHRs and half
your problems will be solved.

Also be careful when sending an array of data.  When you have
identically named pairs you can lose data.  You've got to use the
square bracket notation on your names, check out this demo i set up.
The responder justs print_r() the $_POST array..

http://positionabsolute.net/projects/javascript/name-pair-test.html


Lose data
var str = "name=matt&name=william&name=tobie&name=sam";

preserve data
var str = "name[]=matt&name[]=william&name[]=tobie&name[]=sam";










On Nov 14, 4:21 pm, TheWis <[EMAIL PROTECTED]> wrote:
> Hi Guys, I am writing this code to pull URLs form txt file and pass
> them to an array .. (this part is working well)  but the second part
> which is sending each array element to external PHP file to get some
> results is not working for me.
>
> The Text3.txt file is looking like this:
>
> http://site.info/http://site1.info/http://site.com/
>
> You can assume the blogs.php file will look like this :
>
> <?
>    $keyword=$_REQUEST['keyword'];
>         echo $keyword;
> ?>
>
> Anybody can help me in that ? your help will be appreciated guys ..
> here is my code
>
> <html>
> <head>
> <meta http-equiv="Content-Type" content="text/html;
> charset=windows-1252">
> <script src="prototype.js"></script>
> <title>JS</title>
> </head>
> <body>
> <SCRIPT LANGUAGE = JAVASCRIPT>
>       var request = new ActiveXObject('Msxml2.XMLHTTP');
>       request.open('get', 'Test3.txt', true);
>       request.onreadystatechange = extractURLs;
>       request.send();
>        // document.write(responseText);
>        function extractURLs() {
>        // if (request.readyState == 4 && request.status == 200) {
>            urlArray = request.responseText.split("\n")
>            start_your_function(urlArray);
>        // }
>        document.write(urlArray.length);
>
>       }
>             document.write(urlArray[5] + "<br />");
>       var i=0 ;
>       var dd= urlArray.length - 1;
>
>        document.write(dd);
>        document.write(i);
> for (i=0;i<=dd;i++)
> {
>  var keyword=urlArray[i];
> // When I add this part it is not working any more
>                    var request2 = new ActiveXObject('Msxml2.XMLHTTP');
>
>      new Ajax.Request('blogs.php?='+keyword, true);
>
>      Ajax.Responders.register(responder);
>
>          document.write(i);
>
>       document.write(keyword + "<br />"); */
>
>                }
>
>       </SCRIPT>
>
> </body>
>
> </html>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to