Subscribe Now!

Enter your email address:

Monday, January 31, 2011

How to Separating custom code in different file in Jquery



jqCustom.html
<html>
<head>
<title>The jQuery Example</title>
<script type="text/javascript" src="jquery-1.4.2.js">
</script>

<script type="text/javascript" src="custom.js"></script>
</head>
<body>
<div id="mydiv">
Click here to see a dialogue box.
</div>
</body>
</html>






custom.js
$(document).ready(function() {
  $("div").click(function() {
  alert("Hello Friends!");
  });
});

We can include "custom.js" file as :
<script type="text/javascript" src="custom.js"></script>


0 comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...