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');
    
    评论

报告相同问题?

悬赏问题

  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!
  • ¥15 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?