Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

snippets

Name: Anonymous 2011-01-27 14:58

This works fine:
javascript:localStorage.setItem('chanchan',document.getElementsByTagName('textarea')[0].value);


This one doesn't work:
javascript:localStorage.setItem('chanchan',document.getElementsByName('com')[0].value);

This one loads the value into the body instead of the textarea, and deletes everything else:
javascript:document.getElementsByTagName('textarea')[0].value=localStorage.getItem('chanchan');

Explain this bullshit.

Name: Anonymous 2011-01-27 15:05

10 GET

Name: Anonymous 2011-01-27 15:05

JACKSON 5 GET

Name: Anonymous 2011-01-27 15:16

check them dubs

Name: VIPPAR 2011-01-27 15:31

JAWS

Name: Anonymous 2011-01-27 16:27

Bump for an actual answer?

Name: Anonymous 2011-01-27 16:44

>>6
Just see >>2-5, do you think they'll give you any answer? Correct, no. Go away,

Name: Anonymous 2011-01-27 16:56

What's to explain? Maybe you should learn JavaScript.

Name: Anonymous 2011-01-27 16:57

>>8
Explain why the second one doesn't work and why the 3rd one loads the value into the body and not the textarea.

Name: Anonymous 2011-01-27 17:00

>>9
the 3rd one loads the value into the body and not the textarea
it doesn't.

Name: Anonymous 2011-01-27 17:10

>>10
It does to me.

Name: Anonymous 2011-01-27 17:14

About the second one, nevermind it seems to work.
Still can't figure out why the third one load the local stored data into the body.

Name: Anonymous 2011-01-28 5:48

>>11
stop using a retarded browser. and no, it doesn't do that, it does a completely different thing.

Name: Anonymous 2011-01-28 8:51

>>13
I'm not using a retarded browser.
So what does it do?

Name: Anonymous 2011-01-28 9:11

>>14
You overestimate your browser.

Name: Anonymous 2011-01-28 9:57

1) setItem/getItem is fugly. JavaScript is not ENTERPRISE.
2) You're obviously doing it wrong.
3) This is /prog/. You really expect to get an actual answer about programming here?!
4) ???
5) see >>9,10,13,15

Name: Anonymous 2011-01-28 10:05

>>16
setItem/getItem is fugly. JavaScript is not ENTERPRISE.
HTML5's localStorage is.

???
Back to /b/

see >>9,10,13,15

The correct way to make a post like yours here is:
OKAY YOU FUQIN ANGERED AN EXPERT PROGRAMMER
GODFUQINDAMN
FIRST OF ALL, YOU DON'T FUQIN UNDERSTAND LOCALSTORAGE
SECONDLY, YOUR OBVIOUSLY DOING IT WRONG
THIRDLY, THIS IS /prog/, YOU'LL NEVER GET AN ACTUAL ANSWER HERE IF YOU HAVEN'T ACHIEVED SATORI
AND FUQIN LASTLY, FUCK OFF AND DO YOU'RE HOMEWORD
EVERYTHING HAS ALREAD BEEN ANSWERED IN >>9,10,13,15

Name: Anonymous 2011-01-28 10:06

>>17
*WORK

Name: Anonymous 2011-01-28 11:01

>>17
You just don't know the answer.
I do understand localstorage, this isn't the first time I'm doing it.
Just explain me why the fuck it's loading the value into the body and not the textarea.

Name: >>17,18 2011-01-28 11:06

>>19
I may don't know the answer, but I was just saying to >>16-chan to Go back to /b/, ``please''.

Name: Anonymous 2011-01-28 11:18

>>19
Here, try this: javascript:"hello"
Then contemplate.

Name: Anonymous 2011-01-28 11:27

>>21
Awesome, it does the same thing.
Now explain me why the first one loads the value into the body instead of the textarea and why the second returns an error?

javascript:document.getElementsByTagName('textarea')[0].value=localStorage.getItem('chanchan');

javascript:document.getElementsByTagName('textarea')[1].value=localStorage.getItem('chanchan');

Name: Anonymous 2011-01-28 11:30

>>22
Attach a debugger to your browser and find out.

Name: Anonymous 2011-01-28 11:35

>>23
Uncaught TypeError: Cannot set property 'value' of undefined
There's no second textarea so that's normal, but goddamnit why is it loading in the body?

Name: Anonymous 2011-01-28 11:39

>>22,24
Is that even relevant to the thread now that the answer has been presented and the thread is closed, or is that just your way of telling me IHBT?

Name: Anonymous 2011-01-28 11:57

>>25
I see no answer.
Tell me why it loads the value to the body and not the textarea.

Name: Anonymous 2011-01-28 12:21

HTML5's localStorage is.

I wouldn't call it exactly fugly. My point was that localStorage is supposed to be used as a hashMap rather than using getItem/setItem explicitly.

Go back to /b/, ``please''.

fuck off, ``faggot"


>>26
You're not trying hard enough. Just lrn2javascript.

Name: Anonymous 2011-01-28 12:25

>>26
It would seem you are incapable of abstract thinking and generalization.
Life is wasted on you. Kill yourself.

Then again, it might be you're just unfamiliar with basic Javascript. That's not too bad, really, I can't fault you for that. But you really ought to know enough C to see what's happening.

I hope you can tell how conflicted I am.

Name: Anonymous 2011-01-28 12:32

>>1
Use Firebug and debug.

Name: Anonymous 2011-01-28 12:55

>>28
Don't get your hopes up.

Name: Anonymous 2011-02-03 0:21

Don't change these.
Name: Email:
Entire Thread Thread List