小编KoU*_*rch的帖子

向jquery ui对话框添加类的问题

我正在尝试使用dialogClass属性向我的jQuery对话框添加一个额外的类.这是javascript:

$(function(){
    $( "#toogleMAmaximized" ).dialog({
            title: 'Missions and Achivments',
            autoOpen: false,
            height: 500,
            width: 700,
            modal: true,
            dialogClass: 'noPadding',
            buttons: {
                    Cancel: function() {
                            $( this ).dialog( "close" );
                    }
            },
            close: function() {
                    allFields.val( "" ).removeClass( "ui-state-error" );
            }

    })
    $( "#toogleMAminimized" ).click(function() {
            $( "#toogleMAmaximized" ).dialog( "open" );
            $( "#toogleMAmaximized" ).dialog({dialogClass:'noPadding'});
    });
})

<div id="toogleMAminimized" style="" class="noPadding">
<div class="" style="cursor: pointer;position: absolute;right: 0;top: 45px;"><img src ="images/MAminimized.png" alt="missions and achivments"/></div>
</div>
Run Code Online (Sandbox Code Playgroud)

万一你需要它,我的HTML代码

<div id="toogleMAmaximized" >
<div id="missions"> …
Run Code Online (Sandbox Code Playgroud)

jquery-ui

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

jQuery ajax调用"Not Found"错误

嗨,我一直在尝试对JSP页面进行ajax调用.这是JS函数的一部分.

<script>
$(function(){

  function myAjaxCall() {
     $.ajax({
        type: "post",
        url: "jsp/common/myJavascriptPage.jsp",
        dataType: "text",
        success: 
            function (result) {
               alert("Got the result: " + result);
            },
            error: function (xhr,status,error) {
               alert("Status: " + status);
               alert("Error: " + error);
               alert("xhr: " + xhr.readyState);
            },
            statusCode: {
               404: function() {
                   alert("page not found");
               }
            }
        });
   }
 });
 </script>
Run Code Online (Sandbox Code Playgroud)

即使JSP存在于提到的URL中,我仍然不断找到文件.请注意,我正在计算相对于webapp目录的JSP文件位置.

我尝试使用普通的AJAX调用(没有jQuery),但结果却出现了同样的错误.

你能不能帮我理解为什么它找不到jsp?

javascript ajax jquery

8
推荐指数
1
解决办法
4万
查看次数

jQuery .on()而不是没有事件的.delegate()

是否可以使用jquery .on()方法而不是.delegate()没有要监听的事件?

根据.on()文件:

.on(events [,selector] [,data],handler(eventObject))

events参数是不可选的.

使用.on()/ .delegate()是动态添加元素.

jquery jquery-delegate jquery-on

8
推荐指数
3
解决办法
2855
查看次数

Git 1.7.11 Debian致命:无法为'https'找到远程助手

我正在使用bitbucket和git来管理项目.我在Windows开发环境下没遇到任何问题,但是我在debian挤压方面遇到了问题.克隆时不存在问题,仅在推送时出现.我得到的错误是:

致命:无法找到'https'的远程助手

我尝试用curl编译它,尝试安装几个版本的curl,但没有成功.在这个问题中,git版本是1.7.1,答案是移动到1.7.7,但我的git版本是1.7.11

我怎样才能解决这个问题?

更新:

我的config.log说NO_CURL =''

使用https本身使用curl没问题

UPDATE2:

我的配置也说NO_OPENSSL =''

在root上执行find -name git-remote-*会显示以下信息:

./usr/share/man/man1/git-remote-helpers.1.gz
./usr/local/libexec/git-core/git-remote-fd
./usr/local/libexec/git-core/git-remote-ext
./usr/local/libexec/git-core/git-remote-https
./usr/local/libexec/git-core/git-remote-testgit
./usr/local/libexec/git-core/git-remote-ftps
./usr/local/libexec/git-core/git-remote-ftp
./usr/local/libexec/git-core/git-remote-http
./usr/lib/git-core/git-remote-https
./usr/lib/git-core/git-remote-testgit
./usr/lib/git-core/git-remote-ftps
./usr/lib/git-core/git-remote-ftp
./usr/lib/git-core/git-remote-http
./home/osednaca/git-1.7.11/git-remote-ftps
./home/osednaca/git-1.7.11/git-remote-ext
./home/osednaca/git-1.7.11/git-remote-https
./home/osednaca/git-1.7.11/git-remote-testgit.py
./home/osednaca/git-1.7.11/git-remote-ftp
./home/osednaca/git-1.7.11/git-remote-fd
./home/osednaca/git-1.7.11/Documentation/git-remote-helpers.txt
./home/osednaca/git-1.7.11/Documentation/git-remote-fd.txt
./home/osednaca/git-1.7.11/Documentation/git-remote-testgit.txt
./home/osednaca/git-1.7.11/Documentation/git-remote-ext.txt
./home/osednaca/git-1.7.11/git-remote-testgit
./home/osednaca/git-1.7.11/git-remote-http
./home/osednaca/git-1.7.11/contrib/mw-to-git/git-remote-mediawiki
./home/osednaca/git-1.7.11/contrib/mw-to-git/git-remote-mediawiki.txt
Run Code Online (Sandbox Code Playgroud)

git debian

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

RoR 3.2.8:是否有HTML5组合框助手?

现在,我正在使用form_for.selectoptions_for_selectrails帮助器创建一个包含模型数据的选择框.但是,我真正需要的是像HTML5中引入的组合框:

<input type=text list=browsers >
<datalist id=browsers >
   <option> Google
   <option> IE9
</datalist> 
Run Code Online (Sandbox Code Playgroud)

是否有用于创建此类元素的rails帮助程序?

html5 ruby-on-rails ruby-on-rails-3

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

CoffeeScript - 无与伦比的外观

我一直在尝试将我的工作javascript代码传递给CoffeeScript,但我无法传递此错误:

第55行无与伦比的OUTDENT

这是coffeescript代码

$(document).on("click",".save_button", ->
    $form = $(this).parent().parent().parent().parent().parent().parent()
    $form.bind("ajax:complete", ->
                $actionURI = $form.attr("action");
        $.get(window.location.protocol+"//"+window.location.host+$actionURI+".js",(data) ->
                    $form.parent().parent().prev().html(data); //Line 55
                    closeSaveElement()
        ,"html")
    );
    $form.submit();   
    return false;
);
Run Code Online (Sandbox Code Playgroud)

我已经尝试过放置和擦除;,但我没有错.我也尝试改变->,=>但弹出同样的错误.

javascript ruby-on-rails coffeescript

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

获取从数据库创建组合框时,无法将int隐式转换为字符串

我正在尝试在MVC 3中的创建视图中填充组合框.这是我到目前为止所做的:

    public ActionResult Create()
    {
        var db = new ErrorReportingSystemContext();
        IEnumerable<SelectListItem> items = db.Locations
          .Select(c => new SelectListItem
          {
              Value =c.id,
              Text = c.location_name
          });
        ViewBag.locations = items;
        return View();
    } 
Run Code Online (Sandbox Code Playgroud)

但是当我尝试运行它时会出现编译错误:

Cannot implicitly convert int to string

这篇文章中,我读到了这样做

Value = SqlFunctions.StringConvert((double)c.ContactId)
Run Code Online (Sandbox Code Playgroud)

会解决问题然而当我尝试这样做时,我得到以下错误:

the name 'SqlFunctions' does not exist in the current context

我做错了什么?

更新:

做出Value = c.id.ToString()错误:

LINQ to Entities does not recognize the method 'System.String ToString()' method, and this method cannot be translated …

c# asp.net-mvc-3

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

Javascript onchange()在chrome和IE中不起作用

我有一个总变量,我使用PHP/JS下拉框中的更改时使用刷新获取请求更新.似乎在Firefox中运行良好,但与Chrome/IE完全没有关系.有什么建议?

<form action='cart.php' onchange = 'go()'>
<select id = 'postinfo' name = 'postage'>

<script>
  function go() {
    var x = document.getElementById("postinfo").value;
    if (x == "express") {
        var price = 9.99
        window.location.href = "cart.php?delivery=" + price + "&item=express"; 
    }else if (x == "free"){
        var price = 4.99
        window.location.href = "cart.php?delivery=" + price + "&item=free"; 
    }
  }
</script>
Run Code Online (Sandbox Code Playgroud)

javascript

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