jquery Firefox doesn't fire window.onload -


the following code works fine on chrome in fire fox. works once , if refresh page won't work again. idea on how fix that

<script type="text/javascript">     window.onload = new function() {       $(document).on('click', 'div', function() {             if ($(".ystq_buddy").hasclass("ystq_swipe-right") || $(                    ".ystq_buddy" ).hasclass( "ystq_swipe-left")) {                     $(document.forms['f1']).submit();             }       });  }; </script> 

it works fine when used

$( window ).load(function() { 

thanks efforts.


Comments

Popular posts from this blog

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -