Welcome Guest, Not a member yet? Register   Sign In
simple jquery in CI
#1

[eluser]Unknown[/eluser]
Guys...i am a problem in implementing jquery in CI
i have a controller main.php as

class Main extends CI_Controller{
public function __construct()
{
parent::__construct();
}

public function index()
{
$this->load->view('page/index.php');
}
}
and view i.e page/index.php as
<html>
<head>
<link href="<?php echo base_url();?>js/jquery.js" type="text/javascript" />
<style type="text/css">
#box{
background:#F00;
height:100px;
width:100px;
}
</style>
[removed]
$(function(){ $('a').click(function(){$('#box').fadeOut('slow');
});
});

[removed]
</head>
<body>
<div id="box"></div>
<a href="#">Click here</a>
&lt;/body&gt;
&lt;/html&gt;
i have my jquery library in root jquery folder...
it doesnot show any response..help me guys plzz
#2

[eluser]Peter Guest[/eluser]
Hi,

I suspect your HTML is incorrect. Try using the "script" tag instead of the "link" instead:

Cheers,
Peter
#3

[eluser]josepichu[/eluser]
you must include the rel atribute into the link like this:

&lt;link rel="stylesheet" href="" /&gt;
#4

[eluser]Unknown[/eluser]
[quote author="Peter Guest" date="1330779089"]Hi,

I suspect your HTML is incorrect. Try using the "script" tag instead of the "link" instead:

Cheers,
Peter[/quote]

you are absolutely right..thank u so much..Smile




Theme © iAndrew 2016 - Forum software by © MyBB