javascript-events

Set Printing Preferences from JS

谁说胖子不能爱 提交于 2019-12-18 03:56:49
问题 So... from what I can find on the Google, I can't find a way to use Javascript to set my printing preferences (read: margins, orientations, footer, etc). I am about to tell my boss that what he wants to do isn't possible. I wanted to check will you fine folks priors to doing this. Please let me know. I found that in FF you can use some user_pref(key,val) settings to set up the user's preferences, but that doesn't work for over 90% of my users. I am looking for something that will cover the IE

Microsoft Edge: onclick event stops working?

主宰稳场 提交于 2019-12-18 03:55:23
问题 I have strange problems with my (ASP.NET) web application in Microsoft Edge. At a certain point the onclick event stops working. All buttons on the page that respond to the onclick event stop working. On the same page I have some buttons that respond to the onmousedown event and they keep working. If I refresh the page, the problem is gone. There are no errors in the console. I do not have this problem with other browsers (including IE11 under Windows 10). Did any of you experience similar

Is there a standard for the event order of click and change on a checkbox?

两盒软妹~` 提交于 2019-12-18 03:54:47
问题 I've noticed that the order of 'click' and 'change' events are different in Chrome and Firefox. See this JSFiddle for example: http://jsfiddle.net/5jz2g/3/ JavaScript: var el = $('foo'); var fn = function(e) { console.log(e.type); } el.addEvent('change', fn); el.addEvent('click', fn); In Chrome this logs: change click And in Firefox this logs: click change Is there a standard for the order of events? Which should fire first? The MDN doesn't seem to mention this and I couldn't find a thing

Member not found IE error (IE 6, 7, 8, 9)

女生的网名这么多〃 提交于 2019-12-18 03:04:34
问题 Let me just first point out to any IE users right now (this is not a problem in Chrome, Safari or Firefox) hint hint ;) So... I have a issue with my tooltips in IE, I have a onmouseover listener for all the elements which are to be hoverable and then in my mouseover function I have a very basic cross browser declaration as such... var event = e || window.event, el = event.target || event.srcElement; I've been having issues with the window object not existing in IE or something, this has been

jQuery event to detect when element position changes

南楼画角 提交于 2019-12-18 03:03:14
问题 I would like to know if there is a jQuery event that I can use to determine when a particular DIV's top property has changed. For instance, I have invisible content above a DIV. When that content becomes visible, the DIV is shifted down. I would like to capture that event and then use the offset() function to get the X/Y coordinates. 回答1: The easy answer is that there are no events in the DOM for detecting layout updates. You have a couple options the way I see it: Poll, nasty but it may work

What is the difference between DOM Level 0 events vs DOM Level 2 events?

别说谁变了你拦得住时间么 提交于 2019-12-18 02:58:08
问题 What is the difference between DOM Level 0 events vs DOM Level 2 events? I ask because I was told that Firefox and IE call them in a different order and I had never heard those terms before. 回答1: DOM Level 0 events were based around the concept of using element attributes or named events on DOM elements, e.g.: <input type="button" onclick="clickMe();" /> Or input.onclick = function() { ... }; With DOM Level 2, we've now got a more standardised approach to managing events and subscriptions,

Overriding window.close in Javascript

て烟熏妆下的殇ゞ 提交于 2019-12-18 02:58:07
问题 I am trying to override window.close() Method in javascript . Here is my code. (function () { var _close = window.close; window.close = function () { window.opener.alert("test"); _close(); }; })(); I am trying to bind this code to new window and execute the inner code when the new window is closed. Is is possible to override window.close like this ? 回答1: Try this You can use window.onbeforeunload event to call any function However, alert,prompt,confirm boxes are not allowed. you can return

Overriding window.close in Javascript

断了今生、忘了曾经 提交于 2019-12-18 02:58:01
问题 I am trying to override window.close() Method in javascript . Here is my code. (function () { var _close = window.close; window.close = function () { window.opener.alert("test"); _close(); }; })(); I am trying to bind this code to new window and execute the inner code when the new window is closed. Is is possible to override window.close like this ? 回答1: Try this You can use window.onbeforeunload event to call any function However, alert,prompt,confirm boxes are not allowed. you can return

Javascript/HTML — Toggle Visibility (Automatically causing one div element to hide when another is rendered visible)

情到浓时终转凉″ 提交于 2019-12-18 02:49:10
问题 Essentially what I am trying to do is create a website that has all of its content on the home page but only has some of the content visible at any one time. The way I read to do this is through toggling visibility. The problem I am having is that: Assume the home page, when you first visit the website is blank (the way I want it to be). Lets say you click on the "about us" link. All of a sudden the about us section becomes visible (the way I want it to be). Now the problem that I have come

IE9 makes ajax call correctly only ofter hitting F12

微笑、不失礼 提交于 2019-12-18 02:12:51
问题 I have this jQuery code in my JSP page (jQuery 1.7.2) : function Header() { this.add = function ( parentDiv, leftToolbar, rightToolbar ) { hbHeader = Handlebars.compile( $( "#hb-header" ).html() ); $( parentDiv ).html( hbHeader( {user:{tenantDescription:"", firstName:"", lastName:""}, leftTB:null, rightTB:null } ) ); $.ajax( { url:"${pageContext.request.contextPath}/services/login/sessionUser", type:"POST", async:true, success:function ( result ) { app.user = result; var ltHtml; var rtHtml;