1

I have a little application that generates some Javascript code, what can be executed on websites. To execute this code I'm using browser console and for Firefox it works well, but I can't figure out how to make it work with the Chrome browser.

In Firefox I'm generating this Javascript code:

javascript:var els = document.getElementById('video');els.style="";var none = document.getElementById('slika'); none.style="display:none;"

I open the console (CTRL-SHIFT-K), paste it, press ENTER and then the code is doing it's job. I tried with Chrome via console (CTRL-SHIFT-J), in the address bar, but nothing happens. If I'm trying in the console all I get is this line:

"display:none;"

What does it stand for? Is there some syntax error?

If i try in the address bar, the browser redirects me to google and executes a query with the javascript code as search value :)

So I'm stuck with Chrome...

Can someone help me out, please? Thank you very much!

1
  • It's just displaying the value of the last expression you entered, which is none.style="display:none;". Commented Apr 21, 2014 at 18:43

1 Answer 1

1

You don't need the javascript: prefix if you're entering the code in the console.

Also, I'm not sure if none.style="display:none;" is valid. Try none.style.display="none"; if you're having problems with it.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.