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 NAO机器人的录音程序保存问题
  • ¥15 C#读写EXCEL文件,不同编译
  • ¥15 如何提取csv文件中需要的列,将其整合为一篇完整文档,并进行jieba分词(语言-python)
  • ¥15 MapReduce结果输出到HBase,一直连接不上MySQL
  • ¥15 扩散模型sd.webui使用时报错“Nonetype”
  • ¥15 stm32流水灯+呼吸灯+外部中断按键
  • ¥15 将二维数组,按照假设的规定,如0/1/0 == "4",把对应列位置写成一个字符并打印输出该字符
  • ¥15 NX MCD仿真与博途通讯不了啥情况
  • ¥15 win11家庭中文版安装docker遇到Hyper-V启用失败解决办法整理
  • ¥15 gradio的web端页面格式不对的问题