javascript - Bookmarklet not working/opening in IE10 -


i created bookmarklet (tiny javascript function) works in ie7,8,9 , firefox, chrome, safari not working in ie10. not opening in ie10 when user clicks on bookmarklet button on bookmarks bar.

<a href="javascript:(function(){var jsscript=document.createelement('script'); jsscript.setattribute('type','text/javascript'); jsscript.setattribute('src', '<?php echo base_url()?>bookmarklet'); document.getelementsbytagname('head')[0].appendchild(jsscript); var jq=document.createelement('script');jq.setattribute('type','text/javascript');jq.setattribute('src', '<?php echo base_url()?>js/jquery/jquery-1.8.3.js');  document.getelementsbytagname('head')[0].appendchild(jq);})();" title="bookmarklet"  alt="bookmarklet"  name="bookmarklet"  class="bookmarklet_bt_dragable"  style="cursor:move;">bookmarklet</a>  

the bookmarklet button, clicking bookmarklet has open.

please suggest me how handle problem.

thanks.

in code snippet use

document.getelementsbytagname('head')[0] 

to create head object append javascript file it.

ie10 treat thia unrated due line , result discard javascript code @ time of bookmarklet adding.

please use

document.getelementsbytagname('head').item(0) 

instead of

document.getelementsbytagname('head')[0] 

this line , work if 1 face problem.


Comments