# Scope of a variable?

**URL:** <https://forum.kirupa.com/t/scope-of-a-variable/216021>\
**Category:** Uncategorized\
**Created:** [February 13, 2007, 1:03am UTC](https://forum.kirupa.com/t/scope-of-a-variable/216021 "2007-02-13T01:03:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mauprice](https://avatars.discourse-cdn.com/v4/letter/m/ee7513/32.png) [@mauprice](https://forum.kirupa.com/u/mauprice)\
**Post date:** [February 13, 2007, 1:03am UTC](https://forum.kirupa.com/t/scope-of-a-variable/216021/1 "2007-02-13T01:03:25Z")

</div>

I seem to be having difficulty in using the contents of a variable whan i receive the data from the database the script places the contents in a variable called myText1

This I need to access outside the function.

Any ideas?

This is part of the script below.  
//----------------------------------------------------------------------------------------

mypath = “[http://192.168.0.100/fedpest/pestReports/](http://192.168.0.100/fedpest/pestReports/)”  
mypath1 =mypath + “exterior.php”;

var sendData = new LoadVars();  
var recData = new LoadVars();  
recData.onLoad = getResponse;

```
sendData.id_num = 1;
 	   
                  sendData.sendAndLoad(mypath1, recData, "post");

```

function getResponse(result){

myText1=this[“mytext”];

};

AreasSituationsText.text=myText1;  
//--------------------------------------------------------------------------------------
