what, if browser has javascript disabled, ( AngularJS) [duplicate] - javascript

This question already has answers here:
How to handle JavaScript being disabled in AngularJS
(2 answers)
Closed 8 years ago.
I have learned angular.js, and it's awesome , i'm impressed. i want to use it in my website, but what if our some of user has disabled JavaScript on there browser, they should still gonna see my website content ?????. i'll appreciate your help.

In most cases when js is required, you should add noscript which will be displayed when js is disabled. In that tag you need to warn user that he/she should enable js.

In addition to other answer, I am quoting from Angular book:
Not everyone’s browser supports JavaScript. Let everyone see all of your content and use your app without needing to execute code in the
browser.
The world has changed since these concepts were born. Point #1 is no
longer true for any interesting population. If you’re running a
browser without JavaScript, you’re rele‐ gated to sites created in the
1990s

Or make a div with a warning/notice text (maybe in center of page), and hide that div in js (first thing in your code)
So, if the user does not have js enabled, they will see the nice warning

Related

Disable menus of browser using javascript without opening new popup [duplicate]

This question already has answers here:
can view source be disabled by a website?
(6 answers)
Closed 8 years ago.
Actually I want to protect my source code of my website from everybody.
so I want to disable all sources of finding the code like: Ctrl+U, Ctrl+Shift+I,F12 and menu of browser.
It is impossible to hide your source code. You could install a script to prevent right-clicking or encrypt your code with JavaScript, but that won't stop anyone that knows anything about web development from finding it.
This will never work, and your effort is better spent elsewhere.
At the very least, a user can use a web proxy like Fiddler to easily retrieve the source code.

Hide web page source code [duplicate]

This question already has answers here:
How to hide html source & disable right click and text copy?
(21 answers)
Closed 9 years ago.
I wonder how to hide the source code of a web page. This is an example of webpage with hidden source (right click -> view page source). Any ideas or suggestions?
UPDATE I fully agree, that fully hiding HTML source is impossible, otherwise the browser could't parse it. Using tools like FireBub etc. will show you the source. The interesting in the example above in that on "show source code" the displayed page does not match the output.
Now I understand it is just another kind of technology used here - XSLT.
Thanks for your replies!
If your page is generated dynamically (by Javascript), then it using View Source will not show anything (or very little, anyway). I suspect that's how your example is doing it.
Bear in mind that any page generated this way will still be visible by using a code inspector such as Firebug. So as #Brad M says, this will only stop people who don't really know what they're doing.
If you build the entire page in Java or Flash (or something similar like Silverlight I guess) then it's a lot harder for someone to find out what the source code is (though Java is pretty easy to decompile)
There is no way to hide your code from a client that must execute the code.
Your example just did some trick to prevent right-clicking and stuff. But eventually you can get your way around.
For interpreted language such as javascript, the following adage is true.
" Lock on the door is only for the one who don't care. If there comes thief, most of the time he is already prepared."
All you can do to prevent is obfuscating your code. That will prevent it for some time. But remember, if they are going to crack it, it is not unstoppable. The basic thing to remember is: your script is going to run on the client side and is "INTERPRETED" by browser. In these days, when there are few tools that can create source code from compiled file, the thought of hiding javascript code is even not thinkable. This How can I obfuscate (protect) JavaScript? can help you on how to do it.

Facebook (1) - Update Browser Title With New Notification Number [duplicate]

This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
How can I update the title of the tab in the same way GMail/Facebook does?
How is it possible to update my browser title value, like Facebook and Yahoo, to show a number that represents notifications/pending items/new messages etc.
Right now, my Facebook page title/tab reads [ (3) Facebook ], which indicates I have 3 unread notifications.
How is this possible? I reckon it uses JS and AJAX but I maybe wrong. Has anybody got any snippets, links or suggestions that will get me started in this?
It's a really nice feature but don't seem to find many websites using it, neither can I find any decent tutorials or examples.
Many thanks
It's just a property of the document object
document.title = "some string";
Use whatever logic you like to determine what information you want to put in there.
Be aware that it will produce some really odd bookmark names.
You just need to change title of your page using javascript.
if you are using jquery, it is as simple as -
$('title').text('someText (3)')

Detect if Javascript is enabled? [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
How to detect if JavaScript is disabled?
Is it possible to detect whether javascript has been disabled if so redirect to another page?
My application is being developed with JSPs, as I am using a lot of fancy javascript stuff in my application.
Thanks in Advance
Dean
You can use the <noscript> tag:
http://www.boutell.com/newfaq/creating/detectjs.html
Know this is an old thread, but just thought it add my own solution. I have javascript controlled <div> and on a browser where javascript is disabled, none of these are show so:
Have a standard <div> in center of page saying “please enable javascript to view or click here for non javascript page”
Set the z-value to -1
Have all javascript controlled <div> and set with a white/whatever background and a z-index value to 0 or higher
The javascript controlled <div> will cover the message if enabled, and show it if not.
Hope that this gives one or two of you a few ideas. Although this was specifically for my site, you may find that thinking out the box may help you too.

How can i trace changes made to the DOM by JavaScript? [duplicate]

This question already has answers here:
DOM attribute change debugging
(4 answers)
Closed 9 years ago.
I have a large website in development with a large amount of JS in different files. I have come across an issue where something is removing a class from the DOM. I can see it when I view source but not in Firebug.
Normally I would place some alerts/console.log calls with the hasClass value but because I have no idea where to start I wanted to know if I can trace the change back when it occurs somehow?
Denis
Firebug lets you set a breakpoint and single-step through your code. This should make it clear where the issue is happening.
that specific class name must be in use in that hidden function that remove it, right?
so either grep for it on posix-based system, or, if you are using Win system, use your IDE "search-in-files" function to trace that modification.

Categories