English 中文(简体)
Web Application with jQuery, deployed to WS 2003 and IE not working
原标题:

I have been developing a web application on XP and FF (with occasional IE checks through IE 8), but today when I deployed it to a WS 2003 site, running IE 7, my jQuery code to dynamically size divs doesn t execute, and even stating explicit div sizes (e.g. width: 95%) doesn t seem to work.

I m doing this via VPN and Remote Desktop, and at this point have no contact with support on the remote site. This is a long shot, but does anyone have any suggestions for me to try? I know Javascript is enabled, as I get a test alert box from outside my jquery code. My jQuery code is as follows, in the head tag:

<script src="/jQuery/jquery-1.3.2.js" type="text/javascript"></script>
<script type="text/javascript">
    function resizeChildren() {
        var h = $(window).height() - 70;
        var w = $(window).width() - 210;
        $("#mainContent").css("width", w);
        $("#container").css("height", h);
        $("#leftMenu").css("height", h - 20);
        $("#mainContent").css("height", h - 20);
        $("#ctl00_mainContentPlaceHolder_grid_GridData").height(h - 80);
    }

    $(document).ready(function() {
        resizeChildren();
    });
    $(window).resize(function() {
        resizeChildren();
    });
</script>

EDIT:

I should have included the jQuery link before. I m sure someone more astute than me would have noticed the leading /, which caused the browser to look in the site root, not in my application.

最佳回答

Is your jQuery loaded correctly? Is there a file where your jQuery include points to?

What does this code yield?

alert(typeof $);
问题回答

Is this not happening when you are resizing the window? You could try adding the the $(window).resize() binding inside the document.ready() function?

$(document).ready(function() {
    resizeChildren();

    $(window).resize(function() {
        resizeChildren();
    });
});




相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Transaction handling with TransactionScope

I am implementing Transaction using TransactionScope with the help this MSDN article http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx I just want to confirm that is ...

System.Web.Mvc.Controller Initialize

i have the following base controller... public class BaseController : Controller { protected override void Initialize(System.Web.Routing.RequestContext requestContext) { if (...

Microsoft.Contracts namespace

For what it is necessary Microsoft.Contracts namespace in asp.net? I mean, in what cases I could write using Microsoft.Contracts;?

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签