Jquery- Object不支持此属性或方法 [英] Jquery- Object doesn't support this property or method

查看:121
本文介绍了Jquery- Object不支持此属性或方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好!



我坚持使用对象不支持此属性或方法错误。我已经做了所有可能的方法来检查文件路径(jquery,css),名称,并在阅读了几篇文章后清除了浏览器历史记录。但没有运气。我正在使用Mvc 4和html 5.



此外,当我创建另一个项目解决方案并将其添加到视图时,它工作正常。仅在我现有的项目中,此插件未安装并抛出错误对象不支持此属性或方法。





这是我的问题:





1)我下载了多个选择的jquery插件。



2)它有3个主要文件:



- Jquery文件 - jquery.multiple.select.js-放在In Solution根文件夹中

- CSS文件 - 放置在(在解决方案根/中)内容折叠器

- 图像 - 放置在(在解决方案根目录/)图像文件夹中





以下是我的代码:

在母版页:

< ; script type =text / javascriptsrc =〜/ Scripts / jquery-1.7.1.js>< / script> 
< script src =〜/ jquery.multiple.select.js>< / script>
< script type =text / javascriptsrc =〜/ Scripts / jquery-latest.js>< / script>



In主页面:

 < script    类型  =  text / javascript >  
$(document).ready(function(){
$(' select')。multipleSelect();
});
< / script >

@using(Html.BeginForm( Index,< span class =code-string> Home,FormMethod.Get,FormMethod.Post, new {@id = Formparent,@ name = parentform}))
{

< body>
< table>
< tr>
< td>
< select multiple = multiple >
< option value = 1> 1月< / 选项 >
< option value = < span class =code-string> 12> 12月< / 选项 >
< / select >
< / td >
< / tr >
< / 表格 >
< / body >
}

解决方案

(document).ready(function(){


' 选择')。multipleSelect();
});
< / script >

@using(Html.BeginForm( Index,< span class =code-string> Home,FormMethod.Get,FormMethod.Post, new {@id = Formparent,@ name = parentform}))
{

< body>
< table>
< tr>
< td>
< select multiple = multiple >
< option value = 1> 1月< / 选项 >
< option value = < span class =code-string> 12> 12月< / 选项 >
< / select >
< / td >
< / tr >
< / 表格 >
< / 正文 >
}


Hi All !!

I am stuck with the "Object doesn't support this property or method" error. I have done all possible ways of checking the file path(jquery,css),name and also cleared the browser history after reading few articles. But no luck. I am using Mvc 4 and html 5.

Further when I created another project solution and added this to the view it worked fine. Only in my existing project this plugin is n't getting installed and throwing error "Object doesn't support this property or method".


Here is my problem :


1) I downloaded the jquery plugin for multiple select.

2) It has 3 main files :

- Jquery file - jquery.multiple.select.js-Placed in In Solution root folder
- CSS file - Placed in (In Solution root/)Content fold er
- Image - Placed in (In Solution root/) Images folder


Following is my code :
In Master Page :

<script type="text/javascript" src="~/Scripts/jquery-1.7.1.js"></script>
                 <script src="~/jquery.multiple.select.js"></script>
            <script type="text/javascript" src="~/Scripts/jquery-latest.js"></script>


In the Main Page :

<script type="text/javascript">
$(document).ready(function () {
           $('select').multipleSelect();
       });
</script>

@using (Html.BeginForm("Index", "Home", FormMethod.Get, FormMethod.Post, new { @id = "Formparent", @name = "parentform" }))
{

<body>
 <table>
  <tr>
    <td>
      <select multiple="multiple">
        <option value="1">January</option>
        <option value="12">December</option>
      </select> 
    </td>
  </tr>
 </table>
</body>
}

解决方案

(document).ready(function () {


('select').multipleSelect(); }); </script> @using (Html.BeginForm("Index", "Home", FormMethod.Get, FormMethod.Post, new { @id = "Formparent", @name = "parentform" })) { <body> <table> <tr> <td> <select multiple="multiple"> <option value="1">January</option> <option value="12">December</option> </select> </td> </tr> </table> </body> }


这篇关于Jquery- Object不支持此属性或方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆