Skip to content

Instantly share code, notes, and snippets.

@nithinkumar
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nithinkumar/9546300 to your computer and use it in GitHub Desktop.
Save nithinkumar/9546300 to your computer and use it in GitHub Desktop.
(
function()
{
var e=document.createElement('script');
e.setAttribute('type','text/javascript');
e.setAttribute('charset','UTF8');
e.setAttribute('src','http://assets.yoursite.com/js/yourx.js?r='+Math.random()*99999999);
document.body.appendChild(e)
}
)
()
);
i)	It’s a bookmarklet i.e. when u drag the code to bookmarkbar it get saved in Bookmarks Toolbar and if we click it, it executes the javascript code. 

Here the function doesn’t have a return, so it simply runs the code on the page without reloading. 

This code imports a .js file, so the current page is able to use features of .js file

Here I think void is not necessary because there is no definition or redefinition of a function.

ii)	I think we are trying to pass value to a parameter in .js file
iii)	We can directly write in the body
<script type=”text/javascript” charset = “UTF8” src=”'http://assets.yoursite.com/js/yourx.js?r='+Math.random()*99999999”></script>





2)

| Tables        | Are           | Cool  |
| ------------- |:-------------:| -----:|
| col 3 is      | right-aligned | $1600 |
| col 2 is      | centered      |   $12 |
| zebra stripes | are neat      |    $1 |

---------------
|no | sg |aef |
---------------
getfancyrWindow()	returns the document object of the window
getDomainHost(fullUrl)	
function getDomain()	
window.location.href	Tells us the current URL location of the browser
fancyr_init	
checkStatus()	

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment