What exactly is the fuction of scripts in a browser?

For about two months now I’ve been getting messages like “Script Unresponsive” in Firefox. Firefox has also been giving me a twirling circle with the message of “Not Responding” in the whatever it’s called top bar.

Today I installed Noscript. Works great; I’m not getting unresponsive scripts any more. But what the hell were these scripts doing in the first place, and why am I still getting “Not Responding” when I’ve never seen this in, what 15 years of using Firefox?

Appreciate your help.

What exactly is the fuction of scripts in a browser?

More and more, the poorly written ones are there to fuc up your browser. That’s why they’re called fuctions.

Scripts are like little programs, that get downloaded to your machine along with a web page, and get run in your machine (under the control of your browser). These theoretically can’t really do any harm, and your browser is supposed to prevent the script from doing anything harmful or malicious to your computer. (We pause briefly for a hearty round of uproarious laughter. . .)

Here are a few example of what a script can do:
[ul][li] There’s a form with fields for you to fill in. The script can test your entries to see if they are valid, without having to send your form to the server (which could also test your entries). This allows a lot of error-checking to happen right in your computer without having to send each field over the net to be checked.[/li][li] There are a variety of simple “standard” things that a web page can do without a script. But with a script, the web programmer can cause an infinite variety of “custom” actions to happen whenever you do something – click on a button or link, or even moving your mouse over a piece of the page can trigger a script to do whatever it’s programmed to do. Example: Video ads that start to play as soon as you mouse over them.[/ul][/li]Here’s a real simple example of a page with a script in it, that I wrote: Discount Calculator. It has three fields: One for full price, one for discount percent, and one for the resulting discounted price. You can enter numbers into any two of these fields and then click on the “Calculate” button, and it will compute and fill in the missing field for you.

If you examine the source code for the page (Control-U on many browsers; maybe Command-U on an Apple browser), you can see the entire HTML code including all the JavaScript.

Does Noscript let you let a script through if you need it (as Adblocker does) or does it just block all scripts? I am getting the same behavior as the OP in Firefox and Noscript sounds like the solution as long as it doesn’t get in my way. (I don’t care if video ads don’t play when I mouse over them…)

Yes. You can click on the Options button at the bottom of the screen and decide how you want to handle scripts on this particular page: Allow all, or Temporarily allow all.

I’m not sure how long “Temporarily Allow All” lasts for.
ETA: I’ve had to click the “Temporarily Allow All” today on a few sites just to get the site to work properly. But at least I’m in control of the scripts running on which page, and it’s really helped my … browsing experience today. I was getting really tired of “Unresponsive Script” pop-ups.

Download it. Highly recommended.

Now if I could only figure out the “Unresponsive” message.

Thanks so much!

And thanks Senegoid.

Of course I had to disable scripts on your calculator to get it to work. :slight_smile:

Just got this now. Damned typos! We really need spell check in the subject field.

Huh? :confused: Is this an attempted whoosh?

ETA: (P.S. Try entering invalid data in the discount calculator – either numbers that don’t make any sense, or input that isn’t even a number. The script attempts to catch all or most possible input errors and display an error message – the important point being, that it does this right there in your computer without sending anything back to the server. That’s a big thing that scripts can do.)

But some web pages now have
HUGE HUNGUS SCRIPTS that can, and do, everything up to and including drastically modifying the whole behavior of your browser, not to mention causing your computer to run at the speed of snails. That’s one of the reasons I keep JavaScript disabled almost all the time. If you see a web site that behaves in any “non-standard” way that isn’t the way you’re accustomed to seeing a browser work, there’s probably a script in there fuccing around with it.

What? No. I had to disable scripts on that site to make it calculate.

Do you mean you had to disable NoScript on that site to allow scripts to work? The discount calculator includes a script, that absolutely must be enabled to work. That’s how it computes the things that it computes!

ETA: BTW, re-read Post #8. I added more to it.

The “unresponsive scripts” thing is not normal, and you shouldn’t need NoScript to deal with it. It’s as likely malware or some bad ads on websites as anything. Have you tried 1) AdBlock Plus and 2) running Firefox in safe mode?

As for scripts, these days JavaScript is used for a lot more than just form validations. Many modern websites use it to send and receive data without refreshing the page, a practice known as AJAX (asynchronous JavaScript). You know how when you submit something on a really old website (like this one), you have to reload the whole page before you see the result? Compare that with something like Gmail or Facebook, where you can load new messages and submit things instantly – that’s AJAX at work. Or in Google Maps, how you can zoom in and out and move around and the map will keep loading new tiles without refreshing the page every time, unlike the old MapQuest? That’s also AJAX.

Used in this way, JavaScript allows modern web apps to handle user input instantaneously, instead of one page refresh at a time. Many, many websites now use this functionality, and it’s become the standard way of dealing with real-time user interaction. Flash, Shockwave, and Java (distinct and completely unrelated to JavaScript) used to do similar things, but now they’ve all been superseded by JavaScript because JavaScript has much broader browser and device (especially iPhone/iPad) support.

Anyway, if you don’t use any site newer than 1995 or so, you should be fine leaving JavaScript disabled. Otherwise, if you notice that some sites are broken now, just selectively whitelist them in NoScript.

JavaScript can also be used for other nefarious purposes (tracking you, mainly) and displaying obnoxious ads (which often have malware), but AdBlock Plus or similar addons, with their privacy enhancements enabled, can usually filter those out in a much less destructive manner than NoScript. But if you don’t mind the occasional broken modern website, that’s entirely your choice :slight_smile:

Just as a random test, without JS turned on: Facebook, Google Maps, YouTube, Yahoo Maps, MapQuest, Gmail, Twitter, Amazon, Hotmail, Netflix, and many more websites will all break (meaning they’re not just uglier, they’re completely unusable).

I use a very old Firefox browser on a very old Linux system, and I keep JavaScript disabled most of the time.

Gmail works just fine for me. Even better than fine! I don’t get that side bar with the little ads.

OTOH, the new Google Maps doesn’t work at all, not even with JS turned on. All I get is a blank screen. The older Google Maps worked fine for me with JS turned on. Some other sites do this too.

gmail does have a plain html version that works, but to get the fancy features you need javascript enabled.

But I don’t need no steenkin fancy features! That’s the beauty of gmail! All the basics I need are there even in “basic HTML mode”. Contrast with google maps, which is totally utterly completely 100000% non-functional now on older browsers, even with JavaScript enabled.

They’re pretty fugly anyway, particularly since the new Flat Style came in.

The one thing web designers never realised was that aesthetics matter.

Bah ! I use a very old IceCat !

Noscript is working wonderfully so far. I’m still getting “Unresponsive” from-time-to-time though.