css - Is it possible to add a class to another page with jquery? -


i'm assuming answer question "no", figured worth asking.

is possible add class page on click jquery? example:

lets have 2 pages - "1.htm", , "2.htm". on 1.htm, have 2 links so:

<a href="2.htm" class="red">go page , make red</a>  <a href="2.htm" class="blue">go page , make blue</a> 

if click first link, go "2.htm", , add class of "red" body of 2.htm.

if click second link, go "2.htm", , add class of "blue" body of 2.htm.

possible?

when link page browser loads new page along whole new environment javascript - can't continue execution on new page since original javascript have been discarded.

you can communicate new page though passing parameter somewhere. javscript on new page can retrieve parameter , implement whatever needs @ point.

some options are:

  • add parameter query string of new page
  • write cookie
  • store required information in localstorage.

which works best depend on exact requirements.


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -