小编chi*_*tom的帖子

Javascript/jQuery:在另一个框架中调用函数

我是DOM和JavaScript的新手,在尝试从顶层框架或Firebug的上下文中调用框架中定义的函数时遇到了一些问题.

鉴于以下框架集:

<html>
    <body>
    <frameset cols="*" rows="81,*">
        <frame id="topFrame" tabindex="1" name="topFrame" noresize="noresize" scrolling="No" src="hometop.aspx"/> 
        <frameset border="0" cols="214,*" frameborder="no" framespacing="0">
            <frameset border="0" cols="*" frameborder="no" framespacing="0" rows="70,*">
                <frame tabindex="-1" id="chatFrame" name="chatFrame" scrolling="No" noresize="noresize" src=""/>
                <frame tabindex="-1" id="leftFrame" name="leftFrame" noresize="noresize" src="leftFrame.aspx"/>
            </frameset> 
            <frame tabindex="-1" id="mainFrame" name="mainFrame" src=""/>
        </frameset> 
        <noframes>Your browser does not support frameset.</noframes> 
    </frameset>
    </body>
</html>
Run Code Online (Sandbox Code Playgroud)

我正在尝试编写一个javascript钩子,它将在首次打开上述文档时调用#leftFrame中定义的javascript函数.我在加载jQuery的Firebug会话中执行此操作.

jQuery("#leftFrame")返回一个框架DOM元素.现在我想在框架的上下文中执行我的函数(openLink,在leftFrame.aspx中的普通旧脚本标记中定义).我的理解是该函数将是leftFrame文档元素下的DOM节点.但是我无法掌握框架的文档.

我试过了:

 jQuery("#leftFrame").document
 jQuery("#leftFrame").contentDocument
 jQuery("#leftFrame").find("html")
Run Code Online (Sandbox Code Playgroud)

另外,在Firebug中检查DOM树时,我无法在任何DOM节点下看到openLink函数,正如我所期望的那样.

谁能帮我吗?

javascript jquery frames

3
推荐指数
1
解决办法
9581
查看次数

何时为直接Tomcat抛弃Java EE容器(即JBoss)

目前我们部署到JBoss 4.2,因为这是部署在我们集群上的应用服务器.该应用程序目前只使用JBoss的连接池处理通过JNDI和JBossWeb的嵌入式Tomcat以及几个JBoss的Tomcat阀门(特别是RewriteValve,我们自己很难做到).

JBoss对我来说似乎有些过分,如果我们切换到直接的Tomcat,还是留在JBoss有什么好处?Tomcat是否与Eclipse更好地集成?

jboss tomcat

2
推荐指数
1
解决办法
2446
查看次数

在这段代码中我需要把'return false'?

当我点击'slide-toggle'链接时,我的网址从mysite.com变为mysite.com/#

有人告诉我,我需要在这里的某个地方放一个"返回假",但我不知道在哪里.有人可以帮助我吗?

$(document).ready(function() {
    $('a#slide-up').click(function () {
        $('.slide-container').slideUp(function(){
            $('#slide-toggle').removeClass('active');
        });
        return false;
    });

    $('a#slide-toggle').click(function() {
        var slideToggle = this;
        if ($('.slide-container').is(':visible')) {
            $('.slide-container').slideUp(function() {
                $(slideToggle).removeClass('active');
            });
        }
        else {
            $('.slide-container').slideDown();
            $(slideToggle).addClass('active');
        }
    });
});
Run Code Online (Sandbox Code Playgroud)

javascript jquery

2
推荐指数
1
解决办法
224
查看次数

将Dictionary <A,B> + Dictionary <B,C>组合起来创建Dictionary <A,C>

有什么很酷的快速方法可以让两个字典创建第三个,将第一个键映射到内连接样式中的第二个值?

Dictionary<A,B> dic1 = new Dictionary<A,B> {{a1,b1},{a2,b2},{a3,b3}};
Dictionary<B,C> dic2 = new Dictionary<B,C> {{b1,c1},{b2,c2},{b4,c4}};

Dictionary<A,C> dic3 = SomeFunction(dic1,dic2);
// dic3 = {{a1,c1},{a2,c2}}
Run Code Online (Sandbox Code Playgroud)

c# dictionary

2
推荐指数
1
解决办法
367
查看次数

MSB4064:"MSBuild"任务不支持"BuildInParallel"参数

我有一个MSBuild构建文件,可以在我的本地开发框上正确运行但在我们的CI构建框上失败.

失败的构建目标如下:

<Target Name="Clean">
  <MSBuild Projects="Solution.sln" Targets="Clean" BuildInParallel="True"/>
</Target>
Run Code Online (Sandbox Code Playgroud)

并且构建框上的错误是这样的:

"E:\TRUNK\build\Bamboo.build" (Build target) (1) ->
25-Oct-2011 10:22:51    (Clean target) -> 
25-Oct-2011 10:22:51      E:\TRUNK\build\build.build(19,55): error MSB4064: The "BuildInParallel" parameter is not supported by the "MSBuild" task. Verify the parameter exists on the task, and it is a settable public instance property.
25-Oct-2011 10:22:51      E:\TRUNK\build\build.build(19,5): error MSB4063: The "MSBuild" task could not be initialized with its input parameters. 
Run Code Online (Sandbox Code Playgroud)

两台机器报告都有MSBuild版本4.0.30319.1

Microsoft (R) Build Engine Version 4.0.30319.1
[Microsoft .NET Framework, Version 4.0.30319.237]
Copyright (C) …
Run Code Online (Sandbox Code Playgroud)

msbuild continuous-integration

1
推荐指数
1
解决办法
1291
查看次数