# Loading data into variables

**URL:** https://forum.kirupa.com/t/loading-data-into-variables/120774
**Category:** Uncategorized
**Created:** [August 27, 2004, 9:06am UTC](https://forum.kirupa.com/t/loading-data-into-variables/120774 "2004-08-27T09:06:58Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Hiro](https://avatars.discourse-cdn.com/v4/letter/h/b5ac83/32.png) [@Hiro](https://forum.kirupa.com/u/Hiro)
#### Post date: [August 27, 2004, 9:06am UTC](https://forum.kirupa.com/t/loading-data-into-variables/120774/1 "2004-08-27T09:06:58Z")

</div>

Hi all,

I am trying to load data into a variable. This part works fine

```auto
 
 loadText = new loadVars();
 loadText.load("htmltextFile.txt");

  loadText.onLoad = function(success) 
  {
   if (success) {

			  tb1.htmlText = this.content;
		 }
   else{   
			  tb1.htmlText= "Online Content Unavailable, Loading Offline Version";
   }
 

```

This works fine and it loads it into the text field tb1.

However if i change this to

var var1 = this.content

then at a later stage do

tb1.htmlText = var1

this doesnt work :(…

Any idea?
