dongmijgnnq0118 2016-02-09 18:15
浏览 72

如何使用eclipse-mars IDE将jquery插件设置到我的codeigniter项目中


I have downloaded jquery-validation-1.14.0.zip file from web. And know I am trying to use it in my project, but the problem with me is i don't know exactly where to place the folder(extracted file) in my wamp folder, and what are the changes to be made on any of the config or .htaccess file. As i have given all my complete 3-4 days to configure it by my own, but finally left with no options and i am posting my question here so that anyone here can help me out. basically here is my folder sructure;- C:\wamp\www\developer\jquery-validation

controller:- C:\wamp\www\developer\application\controllers

How do i use to call the script file in my view:-

<html>
<head>
<script type="text/javascript" src ="../jquery-validation/lib/jquery.js">      </script>
<script  type="text/javascript" src ="../jquery-validation/dist/jquery.validate.js"> </script>
</head>

And another thing that i would like to emphasis here is, in eclipse-mars, i have included jquery library too. And now i have jquery 2.0 library inside Javascript Resources.

After doing all these when i simply try to use alert function, i got to see lots of errors. Errors:-
GET http://localhost/developer/index.php/jquery-validation/lib/jquery.js [HTTP/1.1 404 Not Found 27ms]
GET http://localhost/developer/index.php/jquery-validation/dist/jquery.validate.js [HTTP/1.1 404 Not Found 30ms]
ReferenceError: $ is not defined

Please get me rid of all these anyhow.. Now i'm totally frustrated.. Very Very Thanks in advance..

the problem remains the same @praveen and @ ichadhr. For more clarification of my code, here is a simple view:

<html>
<head>
<script type="text/javascript" src ="<?php echo base_url('jquery-validation/lib/jquery.js');?>" ></script>
<script  type="text/javascript" src ="<?php echo base_url('jquery-validation/dist/jquery.validate.js');?>"></script>
</head>
<body>
<form method="post" id="myform">
<div class="form-group">
<label for="name">Name:</label>
<input type="text" class="form-control" name="name" id="name">
</div>
<button type="submit" class="btn btn-default" id="sub">Submit</button>
</form>

<script>
$("#sub").click(function(){
    alert("hello");
    $("#myform").valid();
});
</script>
</body>
</html>


And my base url is localhost/developer
and the folder and file locations for js file are as in my code.
Errors are still same

  • 写回答

2条回答 默认 最新

  • ds0802 2016-02-09 22:20
    关注

    All included assets bind with

    base_url('path/to/script.js');
    

    And all links generate with

    site_url('controller/action/param');
    
    评论

报告相同问题?

悬赏问题

  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料
  • ¥15 使用R语言marginaleffects包进行边际效应图绘制