# loadStrings only works in the editor

**URL:** https://discourse.processing.org/t/loadstrings-only-works-in-the-editor/22807
**Category:** Beginners
**Created:** [July 24, 2020, 1:37am UTC](https://discourse.processing.org/t/loadstrings-only-works-in-the-editor/22807 "2020-07-24T01:37:52Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![CND](https://avatars.discourse-cdn.com/v4/letter/c/e79b87/32.png) [@CND](https://discourse.processing.org/u/CND)
#### Post date: [July 24, 2020, 1:37am UTC](https://discourse.processing.org/t/loadstrings-only-works-in-the-editor/22807/1 "2020-07-24T01:37:52Z")

</div>

I downloaded this working sketch but it didn’t work on my desktop.  
Do I need a server to make loadStrings() get me a local disc file?  
I will downloaded the project in the future when I figure out how:)  
Mac 10.14.6. Thanx.

---

<div class="post-metadata">

### Author: ![CND](https://avatars.discourse-cdn.com/v4/letter/c/e79b87/32.png) [@CND](https://discourse.processing.org/u/CND)
#### Post date: [July 24, 2020, 1:40am UTC](https://discourse.processing.org/t/loadstrings-only-works-in-the-editor/22807/2 "2020-07-24T01:40:09Z")

</div>

This is the code:

var result;  
function setup() {  
createCanvas(600, 300);

```
result = loadStrings( 
        "prism.txt", fileLoaded); 

```

}

function fileLoaded() {  
for ( i=0 ; i\<10; i += 1) {  
print(result[i]);   
}  
} **strong text**

---

<div class="post-metadata">

### Author: ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)
#### Post date: [July 24, 2020, 2:07am UTC](https://discourse.processing.org/t/loadstrings-only-works-in-the-editor/22807/3 "2020-07-24T02:07:33Z")

</div>

> [@Maximum size of a method in Processing](https://discourse.processing.org/t/maximum-size-of-a-method-in-processing/17136/29):
>
> Another workaround: [Chrome-allow-file-access-from-file.com](http://Chrome-allow-file-access-from-file.com) A more complete solution: More solutions: [GitHub.com/processing/p5.js/wiki/Local-server](http://GitHub.com/processing/p5.js/wiki/Local-server)

---

<div class="post-metadata">

### Author: ![CND](https://avatars.discourse-cdn.com/v4/letter/c/e79b87/32.png) [@CND](https://discourse.processing.org/u/CND)
#### Post date: [July 24, 2020, 5:43pm UTC](https://discourse.processing.org/t/loadstrings-only-works-in-the-editor/22807/4 "2020-07-24T17:43:55Z")

</div>

You have confirmed that loadStrings() does need a server for the same reason that my attempts to use Ajax locally have failed. This also means if I put the project on my website it should work. Is it enough to put just the model files on the web and run the p5js locally?

I want to send off my javascript program to show others my furniture designs. So it seems the only way to do this now is to include the model files in the header as \<!script src=“g3s.js”\> or add them directly as a script function. Thanx.
