r/AskReddit • • Feb 15 '12

Why the hell does anyone program their website to automatically play music? Isn't this universally hated?

I'd say roughly 70% of the time the music is WAY too loud, too. I would list all of the websites that I hate that do this, but there are too many.

2.2k Upvotes

1.7k comments sorted by

View all comments

636

u/McBurger Feb 16 '12

Or a back button that you need to spam 4 times to return back about 6 pages to leave.

I cannot see the purpose of scripting the back button to be useless on a single click.

"Oh, I tried to click back to go to Google, but I'm still here. Guess I'll stay." Dat ad revenue.

160

u/rgraham888 Feb 16 '12

It's a function of redirection - you get redirected to the target page, and when you hit the back button one time, the redirect page takes you back to the target page.

128

u/deimios Feb 16 '12

META redirects = bad. breaks the back button. Javascript redirects = bad. breaks the back button. HTTP 302 or 303 = better, doesn't break the back button.

7

u/rmd235 Feb 16 '12

Why don't they use this?

5

u/jsims281 Feb 16 '12

Its not always possible. JavaScript redirects can be done after the page has loaded, based on other factors like what browser you are using for example. 301 redirects need to be set up server-side before the page loads, I.e. Everyone, no matter what, will be redirected to the same place. 301 is the code for 'Moved Permanently', and it is usually used for just that, I.e. A URL has changed on your site but you don't want anyone who hits your old URL to get page not found.

→ More replies (2)
→ More replies (6)

41

u/[deleted] Feb 16 '12

That is why the

location.replace()

method was invented about ten years ago. Netscape 3, I think?

94

u/lahwran_ Feb 16 '12

no ಠ_ಠ

proper redirects don't even use javascript, they use HTTP 301 and HTTP 302. Those are standard HTTP responses that are encountered very often (bit.ly uses them, among others) so if your browser doesn't treat them correctly, then that's it's problem.

→ More replies (5)

13

u/imahotdoglol Feb 16 '12

The hell...

JavaScript method location.replace(URL) immediately redirects to the specified URL location. After calling replace() method ,you cannot go back to the previous URL using browser's "Back" button. Syntax for replace() method is as follows :

Syntax : location.replace(URL);

Where URL is the location which is to be replaced by current browser's history entry.

Why doesn't anyone use this?!

11

u/[deleted] Feb 16 '12

Because we have much better ways to redirect things than using JavaScript. Like...301s....or in the event of a form it'd just be part of the PHP.

JavaScript is GREAT but people have been in the habit of using it inappropriately all over the web.

→ More replies (1)
→ More replies (2)
→ More replies (5)

73

u/[deleted] Feb 16 '12 edited Feb 16 '12

I tried to see if there's an extension to prevent websites from doing this, and here's what I got.

ಠ_ಠ

edit: switched from google query to screenshot, thx devynci.

46

u/[deleted] Feb 16 '12

Why would someone disable the back button?

65

u/[deleted] Feb 16 '12

Increased ad loads.

59

u/[deleted] Feb 16 '12

:o Genius! I can now generate tens of more dollars!

→ More replies (1)

21

u/Slime0 Feb 16 '12

It's common for inexperienced people who are adding state-based functionality to a website (such as a store) to be overwhelmed by the possibilities of the user pressing Back and resubmitting the same form more than once. Disabling the Back button sometimes seems to them like the best or only way to fix this.

12

u/[deleted] Feb 16 '12

If you look at the first link, an example of banking websites is given.

Not everything is a conspiracy, guys.

→ More replies (3)
→ More replies (5)

27

u/[deleted] Feb 16 '12

There should be another plugin, that shoots the site owner in the face if they use the previous plugin

→ More replies (1)

10

u/[deleted] Feb 16 '12

I'm not sure if you realize, but Google results show up differently for different people, as they're personalized. A screenshot would be good next time.

→ More replies (1)

3

u/GherkinPuss Feb 16 '12

Whoa I got the same thing!

2

u/18bananas Feb 16 '12

What really caught my attention is that you're also from Redwood City, small world I suppose.

→ More replies (1)

15

u/Eadwyn Feb 16 '12

Twitter does this and is one of the many reasons I refuse to use it. Thank god for Twitter_bot (or w/e his name is).

9

u/Drunken_Economist Feb 16 '12

Twitter fixed this a while ago

→ More replies (1)

3

u/ironiridis Feb 16 '12

I believe you're referring to /u/tweet_poster, created by /u/aperson (who actually happens to be local to me!)

→ More replies (1)

2

u/gburnaman Feb 16 '12 edited Feb 16 '12

Screw people who do that. And also when you click back and a pop up message asks you if you really want to leave. NO. I thought the back button was my toe nail clippers. OF COURSE I WANT TO LEAVE.

2

u/FancyMoustache Feb 16 '12

This happened to me with that Korean comic. The worst time for that shit to happen.

→ More replies (21)