Subj : Grabbing results from a webpage
To   : The Lizard Master
From : echicken
Date : Thu Aug 20 2020 11:44 am

 Re: Grabbing results from a webpage
 By: The Lizard Master to echicken on Thu Aug 20 2020 09:18:14

TL> This is probably my javascript ignorance, but can I ask how you pass a javascript variable to a url
TL> variable? I tried setting it to a complete string that displays correctly, but I get a 400 error
TL> response from the server.

You can pass in a string, whether it be a variable or a string literal, eg:

req.Get('https://some.web.site/'); // literal
var url = 'https://some.web.site/');
req.Get(url); // variable

TL> var res = req.Get(fullFormedURLThatWorksCopyPaste);

Depends on what fullFormedURLThatWorksCopyPaste is.

TL> I also tried this -

TL> var res = req.Get('http:///some.web.site/page?variable1=' + variable1);

As long as variable1 is a string (or a type that will become a string as needed, but that's a whole other topic). And remove that extra slash near the beginning.

req.Get('http://some.web.site/page?variable1=' + 'some_string');
var param = 'some_string';
req.Get('http://some.web.site/page?variable1=' + param);
var url = 'http://some.web.site/page?variable1=';
req.Get(url + param);

and so on.

---
echicken
electronic chicken bbs - bbs.electronicchicken.com
� Synchronet � electronic chicken bbs - bbs.electronicchicken.com