开发者

Can Windows' enhanced security break jQueryUI's datepicker?

开发者 https://www.devze.com 2023-03-02 03:41 出处:网络
I\'m experiencing a weird problem trying to debug an ASP.NET + jQuery + jQueryUI web application developed by someone who left the company a couple of months ago.

I'm experiencing a weird problem trying to debug an ASP.NET + jQuery + jQueryUI web application developed by someone who left the company a couple of months ago.

The problem:

To develop we use a Windows Server 2008 R2 virtual machine or a Windows Server 2003 R2 virtual machine, both of them shared through Terminal Services by all the developers and controlled by our IT department.

Both of them comes with Internet Explorer 8 and have enhanced security on.

When I try to debug the application, or try to navigate it on the test site, certain JavaScripts function are not working.

One of them is jQueryUI's datepicker: the calendar opens, but when I click on a date nothing happens.

I already added both http://localhost and the test site in Internet Explorer's trusted sites, but to no avail; if I remove them from the trusted sites list (so they are run in the internet zone) no JavaScript get executed.

The question:

Could this problems be caused by Windows' enhanced security?

If not, what can I try to narrow down the culprit?

I know this kind of problem should be addressed by the IT team, but they don't care much about it, and I'm stuck as I can't reproduce a couple of bugs happening only in Internet Explorer (this JavaScript blocking thing is preventing me from even reaching the bug), and I can't reply to our user "sorry but we won't fix the problem 'cause IT don't care about us".

Yes, I can escalate this issue with my manager, but you know how bureaucracy is, it would take days or even weeks of e-mails to get this sorted. So I thought if I can narrow down the issue maybe I can save myself some empty arguing.

An example:

I've made a simple HTML page to reproduce the problem:

<!DOCTYPE html>
<html>
    <head>
        <link href="jquery-ui.css" rel="stylesheet" />
        <script src="jquery.min.js"></script>
        <script src="jquery-ui.min.js"></script>
        <script>
            $(document).ready(function () {
                $("#dynamicText").text("Some dynamic text."); // <-- Works.
                $("#date").datepicker(); // <-- Does NOT work.
   开发者_C百科             $("#button").button(); // <-- Works.
                $("#button").click(function (event) {
                    event.preventDefault(); // <-- Works.
                    alert("You clicked the button."); // <-- Works.
                });
            });
        </script>
        <title>Test</title>
    </head>
    <body>
        <h1>Test</h1>
        <table>
            <thead>
                <tr>
                    <th>Function</th>
                    <th>Demo</th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td>Dynamic text:</td>
                    <td id="dynamicText"></td>
                </tr>
                <tr>
                    <td>Date picker:</td>
                    <td><input id="date" type="text" /></td>
                </tr>
                <tr>
                    <td>Button:</td>
                    <td><a id="button" href="https://encrypted.google.com/">Click me</a></td>
                </tr>
            </tbody>
        </table>
    </body>
</html>

Update:

I forgot to mention I've found this link on TechNet, but It does not mention what type of scripts will be blocked (as not all of them are blocked, I'm lost), nearly every over result on the internet explains you how to disable enhanced security, but not what it does.

Any hint is appreciated... :\


If you disable IE Enhanced Security, this issue goes away. I'm not sure if this is a valid workaround, but maybe it could provide a clue.

To disable, open Server Manager. Click Configure IE ESC and disable Enhanced Security for either Administrators or Users.


A stab in the dark maybe but I've had similar problems where the site was being rendered in the local intranet zone and therefore automatically rendered in IE7 compatibility mode. This seemed to cause an error in jquery's browser detection. Adding the following meta tag to the head section fixed it.

<meta http-equiv="X-UA-Compatible" content="IE=8" />

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号