If you were providing an example it would be easier to lend a hand…

> Am 27.03.2016 um 12:17 schrieb jeg <[email protected]>:
> 
> Hi,
> 
> I use un array with 2 values string1 and string2
> 
> string1 is outside request (call before request module)
> string2 inside request module
> 
> How can i get my variable string2  using module request
> 
> I try, global, it doesn't work well
> 
> Thanks for you help
> 
> Eric
> 
> ...
> 
> for (var j = 0, len = arr.length; j < len; j++) {
> ...
> var obj2 = JSON.parse(arr[j]) ;
> console.log(obj2.string1 + ' : ' + obj2.string2) ;
> 
> // string1 string2 are OK
> // string1 is used to build the url, OK 
> ...
> 
> request(string1, function (error, response, html) {
> 
> // request use string1, OK
> 
>   if (!error && response.statusCode == 200) {
>     var $ = cheerio.load(html);
>     $('td.event-favourite').each(function(i, element){
>       var a = $(this);
> 
> 
> ...
> 
> var z1 = 'test :' + string2
> 
> // string2 
> string2 contains the last value
>  
> 
> 
> -- 
> Job board: http://jobs.nodejs.org/ <http://jobs.nodejs.org/>
> New group rules: 
> https://gist.github.com/othiym23/9886289#file-moderation-policy-md 
> <https://gist.github.com/othiym23/9886289#file-moderation-policy-md>
> Old group rules: 
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines 
> <https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines>
> --- 
> You received this message because you are subscribed to the Google Groups 
> "nodejs" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected] 
> <mailto:[email protected]>.
> To post to this group, send email to [email protected] 
> <mailto:[email protected]>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/nodejs/9d2d3659-0d37-449d-b79f-8184cfdcd3f9%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/nodejs/9d2d3659-0d37-449d-b79f-8184cfdcd3f9%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout 
> <https://groups.google.com/d/optout>.

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/EF296929-77B8-4524-9610-7CB31E7C2601%40googlemail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to