umair shahid

umair shahid

  • NA
  • 11
  • 11.1k

Problem in creating tab using JQuery EasyUI

Aug 20 2015 1:01 PM
Hi
i have created tab using JQuery EasyUI
i am writing code which is working correct but the problem is that when i implement same functionality in my other files there i got a error.
the error is
" Uncaught TypeError: $(...).tabs is not a function"
if anyone know why this error is coming kindly help me.
CSS & JS
<link rel="stylesheet" type="text/css" href="http://www.jeasyui.com/easyui/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="http://www.jeasyui.com/easyui/themes/icon.css">
<script type="text/javascript" src="http://code.jquery.com/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="http://www.jeasyui.com/easyui/jquery.easyui.min.js"></script>
This is code HTML
<div style="margin-bottom:10px">
<a href="javascript: void(0);" class="easyui-linkbutton" onclick="addTab('google','http://www.google.com')">google</a>
<a href="javascript: void(0);" class="easyui-linkbutton" onclick="addTab('jquery','http://jquery.com/')">jquery</a>
<a href="javascript: void(0);" class="easyui-linkbutton" onclick="addTab('easyui','http://jeasyui.com/')">easyui</a>
<a href="javascript: void(0);" class="easyui-linkbutton" onclick="addTab('google','http://www.google.com')">google</a>
</div>
<div id="tt" class="easyui-tabs" style="width:400px;height:250px;">
<div title="Home">
</div>
</div>
This is Code of JS
function addTab(title, url){
if ($('#tt').tabs('exists', title)){
$('#tt').tabs('select', title);
} else {
var content = '<div style="width:100%;height:100%;"><h2>'+url+'</h2</div>';
$('#tt').tabs('add',{
title:title,
content:content,
closable:true
});
}
}

Answers (2)