I am referring to the following example for Node and React:
I am able to add a book to the array when javascript is enabled in Chrome. When I disable javascript in Chrome, I am not able to add a book to the array.
Is there any way to resolve this?
I am referring to the following example for Node and React: https://github.com/yldio/react-example
I am able to add a book to the array when javascript is enabled in Chrome. When I disable javascript in Chrome, I am not able to add a book to the array.
Is there any way to resolve this?
Share Improve this question edited Aug 10, 2015 at 19:08 hopper 13.4k7 gold badges51 silver badges53 bronze badges asked Aug 10, 2015 at 18:39 PriyaPriya 1,4814 gold badges32 silver badges56 bronze badges 3- 3 What do you think disabling javascript in the browser does? – Jason Commented Aug 10, 2015 at 18:41
- @Jason what i m trying to do is even if javascript is disabled if content is displayed using node then add should also work. I m trying to understand why does it not work – Priya Commented Aug 10, 2015 at 18:49
- 3 Node is server side, it does not run in your browser. Same thing as if you're talking in the phone after the other side hung up. Just because you're talking doesn't mean the other side is going to hear you because the receiving end is disabled. – Jason Commented Aug 10, 2015 at 18:51
1 Answer
Reset to default 22Is there any way to resolve this?
Not in the way that you're hoping.
React is a JavaScript framework for the front-end. Which means it executes in the browser. If you disable JavaScript in the browser, React doesn't work anymore. Just in the same way if you delete Photoshop from your computer, you can't open .psd files anymore.
If you really must support browsers without JavaScript (which most people don't), you need to build your app to work with plain old HTML based navigation (think links, forms etc).
It's possible to use React (for people with JS enabled) and a fallback for those without, this approach is called Progressive Enhancement. Might be useful to you: https://softwareengineering.stackexchange.com/questions/25969/should-i-bother-to-develop-for-javascript-disabled