Lara
Lara

Reputation: 3021

Downgrade and Upgrade IE

Is there a way we can upgrade/downgrade IE version from Javascript code. Manually we can do using Developer tool by pressing F12. I need to upgrade the IE Version to run Jquery Code snippet and then again downgrade.

Is there a way we can write some scripts on the page to do the same?

Upvotes: 0

Views: 123

Answers (2)

Lance Leonard
Lance Leonard

Reputation: 3285

Alternatively, if you're asking if you can:

1) Dynamically change the document mode to a higher emulation level,
2) Run code for the higher level level, and then
3) Return to the previous document mode:

I'm afraid that answer is also 'No'. There is no JavaScript interface for changing the document mode on the fly.

Document mode is a rendering setting that's set while the page is loading; once it's rendered, you can only change the document mode by reloading the page (and fiddling with the environment)--which resets page contents.

What you can do, however, is:

  1. Load an intermediate page at the higher document level.
  2. Run the process that returns the data using the newer feature.
  3. Open a second document as a lower document mode.
  4. Manipulate the DOM of the second document to incorporate the data results from Step 2.

The solution could be as simple as adding a <div> to the second page and manipulating its textContent, innerText, or innerHTML property (depending on the document mode in question.)

Or something along those lines.

It's hard to be more specific without a clearer idea of what the underlying problem really is.

As yet another alternative, there may be a shim or polyfill for the jQuery feature that runs at the lower document mode. See caniuse or MDN for help finding polyfills.

Upvotes: 1

thesublimeobject
thesublimeobject

Reputation: 1403

It seems like you are asking if you can change the user's browser via JS. The answer to this is definitely 100% no.

Upvotes: 1

Related Questions