Bear Bibeault wrote:According to MDN, this event is supported by Edge. Does it work in other browsers?
Question: you are clearly using jQuery, why are you not using jQuery event handling?
Bear Bibeault wrote:No testing on Chrome or Firefox?
https://learn.jquery.com/events/handling-events/
Bear Bibeault wrote:No testing on Chrome or Firefox?
https://learn.jquery.com/events/handling-events/
Bear Bibeault wrote:Try returning false to stop the event. If that doesn't work, call preventDefault on the event object (passed to the hander, see docs).
Bear Bibeault wrote:Is the handler code executing? What *is* happening?
Bear Bibeault wrote:That last makes no sense: if the handler isn't being called, how would the preventDefault be executed?
What makes you think that the post isn't firing? Have you set a breakpoint to make sure the code is being executed? What sort of error handling do you have in case the post fails?
Bear Bibeault wrote:Did you set a breakpoint?
Do the dev tools shows that the request was triggered? Did it succeed?
Pout a try/catch around the post to handle errors. Also you can add a done callback for the promise just to check if it is being called.
Bear Bibeault wrote:So what you are saying is that the event handler is invoked only on IE and no other browser, correct?
That would be weird as it is supported on all browsers.
If so, then perhaps something at a higher level is at play. Is this code at the top-level, or within other code or handlers?
Bear Bibeault wrote:So what you are saying is that the event handler is invoked only on IE and no other browser, correct?
That would be weird as it is supported on all browsers.
If so, then perhaps something at a higher level is at play. Is this code at the top-level, or within other code or handlers?
Ron McLeod wrote:Unrelated to your current issue - you could simplify this:
with something like this:
Also, it seems odd that you are creating a new instance of FileIndexer but not doing anything with it or keeping a reference to it.
Steve Dyke wrote:The FileIndexer class does several file cleanup functions. It does not return any values. Would this be where I would use interface in lieu of class?
Bear Bibeault wrote:So what you are saying is that the event handler is invoked only on IE and no other browser, correct?
That would be weird as it is supported on all browsers.
If so, then perhaps something at a higher level is at play. Is this code at the top-level, or within other code or handlers?
Paul Clapham wrote:
Steve Dyke wrote:The FileIndexer class does several file cleanup functions. It does not return any values. Would this be where I would use interface in lieu of class?
Well, no, creating an object just so you can use side effects of the constructor to do something, and then discarding the object, that's just weird. Using a static method in that class would be a much more usual way of getting things done without creating an object.
Bear Bibeault wrote:You shouldn't have to do the conditional.
P.S. Why bother with IE? Even MS doesn't support it.
Steve Dyke wrote:To use a static method of a class will still require the new MyClass to access the static method wont it?
Paul Clapham wrote:
Steve Dyke wrote:The FileIndexer class does several file cleanup functions. It does not return any values. Would this be where I would use interface in lieu of class?
Well, no, creating an object just so you can use side effects of the constructor to do something, and then discarding the object, that's just weird. Using a static method in that class would be a much more usual way of getting things done without creating an object.
Steve Dyke wrote:Can this be scoped to Application or just session?
Paul Clapham wrote:
Steve Dyke wrote:Can this be scoped to Application or just session?
No, you can only scope objects. But the code you posted didn't scope the objects you were creating so I don't see why that's a relevant question.
Steve Dyke wrote:
I just want to be clear. If I use static methods will they be bound to the session?
So if I call the static method with parameters and the properties of the class are based on a function using the parameters the properties will hold their value until I call the method with a different set of parameters?
Again, no scopes.And again all this will be at the session level?
Bear Bibeault wrote:Again, no scopes.
Steve Dyke wrote:What about the java heap? Will it reduce since I am not having to use the new keyword to create an object of the class?
Paul Clapham wrote:
Steve Dyke wrote:What about the java heap? Will it reduce since I am not having to use the new keyword to create an object of the class?
I wouldn't expect any change because of that. Creating an object and not assigning it to any variable means that it can be garbage collected.
Paul Clapham wrote:Yes.
And then the flying monkeys attacked. My only defense was this tiny ad:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
|