In most browsers if you enter javascript:$('element').css('property', 'value');
will result in the javascript code being run.
In firefox this will cause the page to change to a blank white page with [object] [object]
why is this?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Because Firefox shows the return value of that function. Add
void(0);after it to avoid a page redirect. Example:My preffered way to run code in URLs:
In this way, you don’t mess with the global namespace:
Here,
window.ycontains now1, whereaswindow.yisundefinedbelow: