variables - Passing javascript via browser URL field -


like title states... there way pass javascript via browser url field.

for example, if had function opened or closed tabs wanted type in browser url + function on page load tabs opened (or closed)

mydomain.com?windows.open=true (something that) possible.

thank in advanced time , responses, appreciated.

there 2 approaches can use:

  1. pass parameters in query string, next page reads query string , based on it

  2. use 1 of many javascript libraries or frameworks allow map hash in url function in javascript (e.g. backbonejs router, example).

the #2 solution more modern approach.

http://mydomain.com/some/page#tabs/open 

and on page javascript allows bind function pattern in hash. sammy.js 1 comes mind.

$.sammy(function() {     this.get("#/tabs/open", function() {         // jquery make sure tabs open     }); }); 

Comments

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -