javascript-events

Click event fires in IE/Firefox, but Chrome is dropping the event assignment

删除回忆录丶 提交于 2019-12-19 18:56:23
问题 I'm in the process of debugging my web application and have hit a wall. I'm experiencing a behavior in Google Chrome only and my javascript ineptitude is keeping me from the solution. I have an ASP page with an <asp:Panel> control. Within the panel, I've setup a simple search textbox and am using an <asp:LinkButton> to launch the search. The user enters their search text and should be able to hit enter (for usability sake) and the search results will display. This works in IE, but not in

Using .on() and e.stopPropagation() on dynamic elements

耗尽温柔 提交于 2019-12-19 17:45:40
问题 I have been experimenting with capturing click events outside of elements using stopPropagation() . $(".container").children().on('click',function(e){ e.stopPropagation(); }); $(".container").on("click",function(){ alert("outside the box?"); })​ Here is a jsFiddle set up to demonstrate it functioning. An alert should fire when you click anywhere outside of the white box. Now, I am trying to have the same principle applied to dynamically created elements. As far as I understand, the on()

Excel VBA controls Webpage with Knockout; appears to work; but nothing is saved

删除回忆录丶 提交于 2019-12-19 16:51:11
问题 Summary: Basically trying to edit a website with Excel VBA. The edits appear to work, but when I use the save button, nothing is saved. I know the save button works, explained below. So why isn't my updated data, which is visible on the screen being saved? The story: I have this code I have been working on for awhile with Excel VBA. It opens a webpage in internet explorer, navigates where I want, fills out a bunch of data, all which show up on the screen, using various methods, such as: For

Make links in iframe from a different domain open in a new tab [closed]

限于喜欢 提交于 2019-12-19 13:47:15
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 4 years ago . This question is for advanced javascript programmers! -Sorry for my bad english :( We have the following scenario: --- Site A gives me a script. --- I put the script on site B (on index.html) --- The script generate an iframe, that contains a link(< a >) Result => Site B contains an ifame with a

replacing a dropdown menu with a text menu in javascript

半城伤御伤魂 提交于 2019-12-19 11:53:51
问题 I'm trying to replace a drop down menu I have with a text field if someone chooses the "other" option. Right now in my code I have it replacing it with a paragraph element because I'm too lazy to find the exact constructor arguments for setting up a text field. However, when "other" is selected nothing happens. Does anyone know what's wrong with this? <html> <head> <script type="text/javascript"> function testfunc(arg) { if(arg.value == "other") { document.thing.replaceChild(document.test,

Window onload event does not fire in ipad ios 8.4

白昼怎懂夜的黑 提交于 2019-12-19 11:35:49
问题 I am facing following strange issue: Functionality: When I open my website page which has many images and have javascript/jquery used for client side functionality. On clicking each image, all the other images changes their opacity and the selected image shows a <div> containing some information and a video for the image. I have used jquery unveil which loads all the images only after a scroll event is fired on the page. Untill that, it displays a "loading" image. I have added a javascipt on

Event Handling when option is selected from dropdown menu

一笑奈何 提交于 2019-12-19 11:19:43
问题 I have a form wherein I have to select an item from the drop down menu and display the selecetd value on the form. The values in the dropdown menu come from the database. Here is my code of select: <aui:select id="empName" name="empName" onChange = "showEmpName()"> <% List<Employee> EmpList = EmployeeLocalServiceUtil.getEmployees(-1,-1); for(Employee emp : EmpList ) { %> <aui:option value='<%=emp.getEmpFname()%>' name = "leaveEmp" onClick = "showEmpName()"><%=emp.getEmpFname()%> <%=emp

How do i change Background color of textbox when onfocus?

笑着哭i 提交于 2019-12-19 10:43:36
问题 i tried this code but its not working.. when i on-focus textbox it shows error function ChangeBgColor(obj, evt) { if(evt.type=="focus") style.background ="lightgrey"; else if(evt.type=="blur") { style.background="white"; } } 回答1: What is style ? You have not defined it anywhere in your code above: function ChangeBgColor(obj, evt) { if(evt.type=="focus") style.background ="lightgrey"; //<--what is style? else if(evt.type=="blur") { style.background="white"; } } I am guessing that you wanted

Does a JavaScript setTimeout function stop when page reloaded?

允我心安 提交于 2019-12-19 10:32:12
问题 If I initiate a setTimeout function from the trigger, will the function stop when the page is reloaded? I initiate a setTimeout function "periodic_update()" on the onload event of my page. Is this creating multiple instances of the periodic_update() function process? <body onload="init_page_onload()"> function init_page_onload() { periodic_update(); } function periodic_update() { foo() setTimeout("periodic_update()", PERIODIC_UPDATE_REPEAT_PERIOD_MS ) } 回答1: When page is reloaded the

Does a JavaScript setTimeout function stop when page reloaded?

寵の児 提交于 2019-12-19 10:32:05
问题 If I initiate a setTimeout function from the trigger, will the function stop when the page is reloaded? I initiate a setTimeout function "periodic_update()" on the onload event of my page. Is this creating multiple instances of the periodic_update() function process? <body onload="init_page_onload()"> function init_page_onload() { periodic_update(); } function periodic_update() { foo() setTimeout("periodic_update()", PERIODIC_UPDATE_REPEAT_PERIOD_MS ) } 回答1: When page is reloaded the