Browser specific bug in my Drag and Drop functionality - javascript

I have a problem with my drag and drop javascript code.
With chrome it works but when I use firefox or internet explorer there are some problems.
For instance, with IE div data set to NULL and with firefox, my webpage is redirecting.
Thanks for all.
http://jsfiddle.net/Fr4NgUs/h399T/
this.innerHTML = event.dataTransfer.getData('text/html');

Related

No drag and drop events fired in IE11

I'm stuck with a problem in IE11.
The drag and drop events are not triggered in IE11.
First I thought it has something to do with the IE settings (security>Allow drag drop).
I use jQuery, but it doesn't work with plain JavaScript as well.
I broke it down to the following piece of code:
<script>
document.addEventListener('dragenter', function (event) {
alert("Dragenter");
});
</script>
When I drag a file from my desktop into the browser, the alert appears.
It works fine with Chrome, Edge, Firefox, but not with IE.
Unfortunately it still doesn’t work in my current project. Even the simple js snippet.
Any Ideas?
I added my site to the trusted sites, enabled ActiveX, Enabled all other scripting settings, but it looks still like the Browser is blocking drag and drop actions for my site.
I've tested on my side and the alert appears successfully.
I suggest that you could check the Drag and Drop feature in your IE.
Go to Internet Options
Go to Security tab
Click on Custom level
Search for Drag and Drop settings and Click on Enables
Click Ok
Solved!
The problem was, that i started my IE as an administrator (from Visual Studio).
It is not possible , to move files from your local users desktop, to an IE in administrator-mode.

Firefox 57 closing dropdown when scrolling up or down

When you open a dropdown, and then scroll up/down a bit, the dropdown is getting closed. It is happening in FF 57.0.3 64 bit, but chrome looks good. This problem was not there until my FF upgraded to 57+. If you try this example in both browser, you will see the same problem.
I was playing around with the both browsers. I don't think this is a bug, seems like a feature specific to browsers. In Chrome they don't let you scroll when dropdown is opened. In Firefox, They let you scroll, by closing the dropdown automatically. Any idea how can I make Firefox to behave same as Chrome?

classlist.toggle() does not work as expected on mobile safari

I have a function to add an open class to a drop down menu so it stays open on mobile browsers
the function worked fine also on safari, but now I saw it doesn't work on safari like before
the problem: it opens up the drop down menu but it doesn't close anymore only if you reload the site (or switch to another one)
tested I have nothing as I have no clue what even could go wrong with that code.
in chrome, firefox, edge also in chrome on android it's working fine
the function is the following (very simple)
function togglenav(tagid) {
document.getElementById(tagid).classList.toggle('navopen');
}
any idea what could go wrong only on safari?
edit: correctet the sentence that should tell on what browsers it's working (forgott the part that stated this)
Reload without content blockers?
Not sure if this is the same case as you're experiencing, but I had almost identical JavaScript that worked in mobile Safari on my wife’s iPhone X, but not on my iPhone 6. Turns out the model was irrelevant. I had the Better ad/tracking blocker running on my iPhone which stopped the script from loading.
If this is the case, tap/hold the URL and “reload without content blockers”. Worked for me, but worth bearing in mind that mobile Safari on my wife’s phone loaded it without a hitch.

window.focus() or window.blur doesn't work in modern browsers?

A project I'm working on requires that we create a pop up window and then change focus back to the parent window. Many solutions that seem to have worked in the past seem to not work at all in many new versions of Chrome, Firefox, and Safari and IOS 8 Safari. For example this W3C demo http://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_win_blur does not work in those browsers but does work properly in IE10 and below.
It seems as though browsers might have started deprecating this feature but I've seen no documentation about it. Could anyone point me to an alternative to window.focus() and window.blur() that will work on IOS 8 Safari or at least some documentation about the methods being deprecated?
----- To elaborate a bit more for my colleague ----- Mike LP
The situation is as such:
We have a web application that requires the explicit use of a popup window. Overlays and iframes are an option due to some technical constraints.
While not desirable, it is okay that the newly created popup window receives focus upon opening, but we have a button on the popup that when clicked should return focus to the parent window, while leaving the popup open.
We've been unable to accomplish this using any of the modern browsers, though we do have a solution that works on iOS 7 Safari. Unfortunately even that appears to no longer work on iOS 8.

open IE browser by default

I created a web site where I would like to have 1 of the button of my menu navigation to open the internet explorer browser. Since the URL I am pointing for this specific button can only be view with IE and not with Chrome, Firefox etc... Which mean if someone is using Chrome for example and want to access this specific link by clicking on it it will open IE browser and see the content. This is feasible? thanks in advance
No, this is not feasible.
Opening in another browser is totally user side. You would have to alert the user that this page is best viewed in Internet Explorer and leave it up to them to download/open Internet Explorer to view it.

Categories

Resources