Dan, my code works fine and is shown on the console perfectly but the page won't show it(it's blank). Do you know why this is happening? I'm running a node HTTP server as you showed in a previous video. I'd really like to continue watching this playlist but I cannot skip this lesson.
When replacing the contents of rainbow.txt to just random words, I must first change the filename from rainbow.txt to something else, and then update the filename in the sketch.js file. It is not enough to just CTRL+A and del the contents of rainbow.txt and add some words to it, CTRL+S, and refresh the webpage. It shows the same contents in the right hand console Array [.....] unless I rename the file all around and refresh. Very strange.
Hey All Very green with JS, stuck on how to load/read multiple files located within a directory(over 70 of them) was able to load one with the preload function ‘loadStrings’, any assistance would be much appreciated.
Interesting, my console.log(txt) didn't cause any text in the console. I'm struggling a lot, managed to create a simple program on python to read a random text line from a text file in the same folder, then tried to figure out how to make it happen in javascript to get it on webpage, but can't even get to the point where I can read the text file. Actually I get error for undefined loadStrings and in general I don't manage to make the text into string format, just a file object.
Hello Daniel! First of all thanks to teach to us for free all this stuff! I have a problem I can't figure it out. How can I use the loadTable or loadString function combined with the createFileInput function (or drag and drop technic) to let a user to upload a CSV file? Thanks for any help!
I didn't understand createFileInput for multiple file access what should i pass in 2nd argument should i pass a callbackfunction for that as well? Shouldn't the documentation also include example code as well googling it I didn't find any results.
p5.js:20602 Failed to load file:///Users/ZhouYi/Desktop/P5/Day12%20AZ%201.1-/1.4%20Loading%20a%20Text%20File/load/rainbow.txt: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https. I tried using live server and chrome or other browser but not work
Hi your video is damn great and helful, but when I try to modify the text file like you did in 02:15 and hit reload the local server, the string didn't change at all. How can I fix it, thanks
There's probably something wrong with my code, or could it be my Chrome? Developer Tools console won't show anything. Just that ">"thing. Is there anything else I need to do?
hello Danii, listen how can i do all this in Processing 2.2? sorry i have written allot of p2 to just leave it behind and redo everything in p3 and UP and most lib for p2 dont even exist in most higher versions of processing. so if im going to upgrade anything its going to be after i export my sketch to bring into a real IDE like netbeans or something like VS13 BUT you're still my guy for learning all the time!
I seem to be getting this in my console: Uncaught TypeError: fxn.bind is not a function at attachListener (p5.js:11756) at p5.Element.mousePressed (p5.js:11079) at setup (sketch.js:18) at p5. (p5.js:9108) at p5. (p5.js:9038) at new p5 (p5.js:9320) at _globalInit (p5.js:5602) sketch.js:18 is : button.mousePressed(load); I've tried with loadfile and many other names for the button and for the " var button = select('#load');" but nothing seems to work.
Turns out, after a bit of debugging that if I replace the HTML button with a p5 button : " var button; button = createButton('Load File'); button.mousePressed(loadFile); " Though it's much more complicated to work around with, it works.
I know that this is old but can someone help me? How do I specify where the createP element is put? Now it's just showing the text inside the body but I want it to be inside a div.
i have a error. p5.js:20255 XMLHttpRequest cannot load file:///C:/Users/SNS/Desktop/A2Z/1.4%20Getting%20Text%20from%20User/hh.html. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource. how can i fix this???
I know it's a little bit late but you can use .split() i think it is. and between the brackets you can give a parameter. for example str = "England,Canada,Australia"; you can do declare an array let's call this array countries, now do countries = str.split(','); As you can see i put a , between the brackets, if your file is separated with a ; replace the , with a ; and so on
Very nice but i have a question is there a way that a can load a .txt file onto my html by just typing the name instead of a button ( example i have a text file named HELP.txt instead of clicking a button i can just type it and will display it's content to my html after ) Reason for asking is because i want to create a personal website / career portfolio but i want that website to have a look and feel of a linux terminal (something that like that) I'm hoping you can help me with query because by far this is the only tutorial that i found useful. thanks again cheers.
Create a variable to hold the user input, when the user inputs a word and pressed enter use keyPressed() to load the text As for adding it to your website you could use the p5 text function or you could use js to edit your html but you will need to google how to do that
I get the same thing. Here is the error. p5.js:20199 XMLHttpRequest cannot load file:///C:/Users/kreen_000/Documents/Atom/Projects/learning/1-4/myText.txt. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.p5.loadStrings @ p5.js:20199(anonymous function) @ p5.js:9083preload @ sketch1-4.js:4(anonymous function) @ p5.js:9045p5 @ p5.js:9320_globalInit @ p5.js:5602 p5.js:20193 p5.js:20171 undefined
This guy is a damn beast at programming
+Totally Beyond Me whatever floats your boat xD
Yes he is, but he drinks too much coffee!
@@cptstubing coffee makes him a genius haha
i know it's pretty randomly asking but does anybody know a good site to watch new tv shows online ?
Dan, my code works fine and is shown on the console perfectly but the page won't show it(it's blank). Do you know why this is happening? I'm running a node HTTP server as you showed in a previous video. I'd really like to continue watching this playlist but I cannot skip this lesson.
When replacing the contents of rainbow.txt to just random words, I must first change the filename from rainbow.txt to something else, and then update the filename in the sketch.js file.
It is not enough to just CTRL+A and del the contents of rainbow.txt and add some words to it, CTRL+S, and refresh the webpage. It shows the same contents in the right hand console Array [.....] unless I rename the file all around and refresh.
Very strange.
OMG, I have been searching how to do that for hours, and I understood it pretty easily
Hey All
Very green with JS, stuck on how to load/read multiple files located within a directory(over 70 of them) was able to load one with the preload function ‘loadStrings’, any assistance would be much appreciated.
Hi, is there a simple way to append some data to a text file ?
Great video. Can you show us how to load text file in JavaScript without using P5 JS framework please? thank you..
Interesting, my console.log(txt) didn't cause any text in the console. I'm struggling a lot, managed to create a simple program on python to read a random text line from a text file in the same folder, then tried to figure out how to make it happen in javascript to get it on webpage, but can't even get to the point where I can read the text file.
Actually I get error for undefined loadStrings and in general I don't manage to make the text into string format, just a file object.
Same issue. I can't figure out how to just prompt the txt file in console..
Hello Daniel! First of all thanks to teach to us for free all this stuff! I have a problem I can't figure it out. How can I use the loadTable or loadString function combined with the createFileInput function (or drag and drop technic) to let a user to upload a CSV file? Thanks for any help!
I opened up a text document on notepad and got this > endobj
147 0 obj
I didn't understand createFileInput for multiple file access what should i pass in 2nd argument should i pass a callbackfunction for that as well? Shouldn't the documentation also include example code as well googling it I didn't find any results.
Which playlist is this video from?
p5.js:20602 Failed to load file:///Users/ZhouYi/Desktop/P5/Day12%20AZ%201.1-/1.4%20Loading%20a%20Text%20File/load/rainbow.txt: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https.
I tried using live server and chrome or other browser but not work
Hi your video is damn great and helful, but when I try to modify the text file like you did in 02:15 and hit reload the local server, the string didn't change at all. How can I fix it, thanks
Possible your browser is caching? Try in chrome, going to console --> settings --> disable cache while console is open.
Thanks a lot, it works for me now!
There's probably something wrong with my code, or could it be my Chrome?
Developer Tools console won't show anything. Just that ">"thing. Is there anything else I need to do?
hello Danii, listen how can i do all this in Processing 2.2? sorry i have written allot of p2 to just leave it behind and redo everything in p3 and UP and most lib for p2 dont even exist in most higher versions of processing. so if im going to upgrade anything its going to be after i export my sketch to bring into a real IDE like netbeans or something like VS13 BUT you're still my guy for learning all the time!
I hope our instructor teaches the way you do! 😭
How doex this work in Processing?
when i enter console.log(table) it shows undefind please help
I seem to be getting this in my console:
Uncaught TypeError: fxn.bind is not a function
at attachListener (p5.js:11756)
at p5.Element.mousePressed (p5.js:11079)
at setup (sketch.js:18)
at p5. (p5.js:9108)
at p5. (p5.js:9038)
at new p5 (p5.js:9320)
at _globalInit (p5.js:5602)
sketch.js:18 is :
button.mousePressed(load);
I've tried with loadfile and many other names for the button and for the " var button = select('#load');" but nothing seems to work.
Turns out, after a bit of debugging that if I replace the HTML button with a p5 button : "
var button;
button = createButton('Load File');
button.mousePressed(loadFile);
"
Though it's much more complicated to work around with, it works.
I know that this is old but can someone help me? How do I specify where the createP element is put? Now it's just showing the text inside the body but I want it to be inside a div.
.parent()
can you tell how to extract particular word only from text file?
how to do it in nodejs and auto update with out run command bro.......any help
loasStrings is undefined, where do you get loadStrings from ???
You'll need the p5.js library, see: p5js.org
i have a error.
p5.js:20255 XMLHttpRequest cannot load file:///C:/Users/SNS/Desktop/A2Z/1.4%20Getting%20Text%20from%20User/hh.html. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.
how can i fix this???
You need to run a local server: ua-cam.com/video/UCHzlUiDD10/v-deo.html
thank you for all video you made
Great video thank you!!! Im thinking of writing a python prgram to write to a text file database and import it to a website!
Where do you teach?
fantastic, but how load a comma seperated file or an XML file into array element, like an array for countries and other for capital cities
I know it's a little bit late but you can use .split() i think it is. and between the brackets you can give a parameter. for example
str = "England,Canada,Australia"; you can do declare an array let's call this array countries, now do countries = str.split(',');
As you can see i put a , between the brackets, if your file is separated with a ; replace the , with a ; and so on
Can you make program get tags from text
Very nice but i have a question is there a way that a can load a .txt file onto my html by just typing the name instead of a button ( example i have a text file named HELP.txt instead of clicking a button i can just type it and will display it's content to my html after )
Reason for asking is because i want to create a personal website / career portfolio but i want that website to have a look and feel of a linux terminal (something that like that) I'm hoping you can help me with query because by far this is the only tutorial that i found useful.
thanks again cheers.
Create a variable to hold the user input, when the user inputs a word and pressed enter use keyPressed() to load the text
As for adding it to your website you could use the p5 text function or you could use js to edit your html but you will need to google how to do that
can I use notepad+++ instead of brackets?
atom is probably better than the both of them see atom.io or to use without installing (no admin rights)
github.com/atom
Where is loadStrings defined ?
Can I read all text files in the dirctory
as long as you give the correct url you can select any txt files
For some reason no matter what i do it always says loading then will never work😥please help i really need this for my game
+Bryce Johnson try looking in the JavaScript console for an error message!
When I looked all it says it undefined
I am also emailing you as well I just sent the link to the forums maybe I'll send you a picture of my code
I get the same thing. Here is the error.
p5.js:20199 XMLHttpRequest cannot load file:///C:/Users/kreen_000/Documents/Atom/Projects/learning/1-4/myText.txt. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.p5.loadStrings @ p5.js:20199(anonymous function) @ p5.js:9083preload @ sketch1-4.js:4(anonymous function) @ p5.js:9045p5 @ p5.js:9320_globalInit @ p5.js:5602
p5.js:20193
p5.js:20171 undefined
Oh i think its because I was simply opening the html file from windows explorer instead of running the page via live preview on a port.
What is loadStrings? Where is that coming from...
Fetch API
How to write to text file
Brilliant Video like always :D
The Queen Of Eagles
Please make an RNN off this feature
I
Great video!
Maybe lay off the caffeine?
Hi.... First???