jQuery function in a external javascript file isnt working -


i have external javascript file function:

$(document).ready(function () {     $("#save").on('click', function () {         window.open('data:application/vnd.ms-excel,' +             encodeuricomponent($('#exporttoexceldiv').html()));         e.preventdefault();     }); }); 

and link looks like:

   <a href="#" title="save"><img src="../../images/glyphicons_446_floppy_save.png"             id="save" name="save"></a> 

but function not working on link. nothing wrong linking between files (tried alert function works)

and functions works when type directly in html.


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -