# Load in new window from txtfile?

**URL:** <https://forum.kirupa.com/t/load-in-new-window-from-txtfile/112697>\
**Category:** Uncategorized\
**Created:** [June 10, 2004, 2:32pm UTC](https://forum.kirupa.com/t/load-in-new-window-from-txtfile/112697 "2004-06-10T14:32:03Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Inflicted](https://avatars.discourse-cdn.com/v4/letter/i/82dd89/32.png) [@Inflicted](https://forum.kirupa.com/u/Inflicted)\
**Post date:** [June 10, 2004, 2:32pm UTC](https://forum.kirupa.com/t/load-in-new-window-from-txtfile/112697/1 "2004-06-10T14:32:03Z")

</div>

I want a textfile to load a site in a new window:

```auto
<a href="http://www.site.nl", **"_blank"** >www.site.nl

```

but this doesn’t work…  
Searched, but couldn’t find the answer,  
Anyone?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 11, 2004, 5:21pm UTC](https://forum.kirupa.com/t/load-in-new-window-from-txtfile/112697/2 "2004-06-11T17:21:39Z")

</div>

This is the code for my textfile:

```auto
var xmlText = new XML();
xmlText.tf = textBox;
xmlText.onData = function(data) {
    this.tf.html = true;
    this.tf.htmlText = data;
};
xmlText.load("dates_test.txt");

```

and here’s my text: [http://home.wanadoo.nl/inflicted/dates\_test.txt.zip](http://home.wanadoo.nl/inflicted/dates_test.txt.zip)

thanks for stickin’ around!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 11, 2004, 5:42pm UTC](https://forum.kirupa.com/t/load-in-new-window-from-txtfile/112697/3 "2004-06-11T17:42:17Z")

</div>

> [@Inflicted](#):
>
> This is the code for my textfile:
> 
> ```auto
> var xmlText = new XML();
> xmlText.tf = textBox;
> xmlText.onData = function(data) {
> this.tf.html = true;
> this.tf.htmlText = data;
> };
> xmlText.load("dates_test.txt");
> 
> ```

???  
Why you’re using the XML object to load text?[SIZE=1](Or am I missing something)[/SIZE]

scotty(-:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 11, 2004, 5:51pm UTC](https://forum.kirupa.com/t/load-in-new-window-from-txtfile/112697/4 "2004-06-11T17:51:19Z")

</div>

Scotty,  
this is a code I once picked up and use all the time(copydog?).  
It doesn’t load xml, it just loads a txt file onData.  
Maybe there’s another code to load a text file that  
doesn’t fail with “\_blank”. if you have one, I could try that out.

Everything o.k. with you?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 11, 2004, 6:17pm UTC](https://forum.kirupa.com/t/load-in-new-window-from-txtfile/112697/5 "2004-06-11T18:17:55Z")

</div>

Use LoadVars()

```auto
myText = new LoadVars();
myText.onLoad = function(success) {
	if (success) {
		mytxtfield.html = true;
		mytxtfield.htmlText = this.info;
	}
};
myText.load("dates_test.txt");

```

Be sure your text in the txtfile starts (in this case) with info=blablabla

scotty(-:
