Joe Morano
Joe Morano

Reputation: 1895

How can I prevent users from manipulating my page via the js console?

I tried to manipulate the divs on facebook.com using the javascript console to see if it was possible. I noticed there was a class called "profileLink", so I typed the following into my console:

$(".profileLink").hide();

But instead of the class being hidden, I got the following error in my console:

Error: <![EX[["Tried to get element with id of \"%s\" but it is not present on the page.",".profileLink"]]]>

But the method I tried works to manipulate other, lower-budget webpages. How did facebook accomplish this?

Upvotes: 1

Views: 177

Answers (1)

dm03514
dm03514

Reputation: 55962

I'm pretty sure Facebook isn't preventing you, but the $ is not associated with jQuery.

$ isn't a built in to browsers, but usually is an alias for jQuery.

Upvotes: 2

Related Questions