how to use javascript for cookies [duplicate] - javascript

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
What is the “best” way to get and set a single cookie value using JavaScript
I am trying to figure out how to use cookies with JavaScript. I am trying to store an email address, address, and phone number. Can anyone help? I have tried looking around the google machine for help, but I am not finding anything useful.

Heard of google? :)
http://www.w3schools.com/js/js_cookies.asp
But if you are using HTML5 it is even easier.
http://www.w3schools.com/html/html5_webstorage.asp

Related

How get user IP at browser without outside APIs? [duplicate]

This question already has answers here:
How to get client's IP address using JavaScript? [closed]
(31 answers)
Closed 6 months ago.
I'm looking for a resolution, how can I get user public IP using only my page. My assumption is not connect to external applications to keep application safe. Page has been built with a ReactJS. Is it possible to do from browser and only JavaScript level? Or do I have to create my custom API to get user IP?
Thanks you advance.
https://codesandbox.io/s/how-to-get-user-ip-address-in-reactjs-kh3xl?from-embed=&file=/src/App.js:140-145
This might be what you're looking for ;)

Javascript stopping people from seeing api and server keys [duplicate]

This question already has answers here:
How do I hide javascript code in a webpage?
(12 answers)
Closed 12 months ago.
Is there a way I can stop people from seeing the Javascript Source code that includes the Server API key and server information?
No, there is not.
You can obfuscate and minify your code, but that doesn't help since your users can look at their browser's Network Inspector instead.

Can you make a email-send system without Php? [duplicate]

This question already has answers here:
What is the difference between client-side and server-side programming?
(3 answers)
Closed 1 year ago.
I really don't understand how Php works and i am a little nervous, i don't like the idea of using more application for a email-send system. Is there anyway to do that without php, only in javascript/html/css? Can someone explain how this works or if is there something i need to know?
I tried to find on google, but i didn't find anything useful. Thanks in advance! :)
Sending mail requires a program to run on a server, and PHP is a language that can talk to a server. You can't send an email using just HTML, CSS and Javascript.

Why big websites don't prefer localstorage over cookie? [duplicate]

This question already has answers here:
Local Storage vs Cookies
(9 answers)
Closed 6 years ago.
I'd like to ask why big players like facebook, google still uses cookies if localstorage is much better and secure for same.
They are not the same thing at all: you can use them in a similar way, but they serve different purposes.
Take a look at this thread: Local Storage vs Cookies

Protecting JavaScript? Or use Something else? [duplicate]

This question already has answers here:
Closed 12 years ago.
Possible Duplicate:
How can I obfuscate JavaScript?
I have been working on a web app in JavaScript. Nearing complete.
How do I protect me JavaScript code from someone copying it? I mean if you view my page source, it references the .js files and one could really steal these.
Should I be using something else? RoR?
Does Google Maps have a RoR API?
Your closest bet would be to use something like
A Javascript Obfucator
A Javascript Minifier
A Javascript Packer
People will still be able to steal and use your code though, it will just be harder to modify.

Categories