triggering a plugin from within function
Hi Folks,
I'm playing with jQuery and I'm having a problem with this code;
Problem: trigger a pluggin that gets called from .click(function(){};
Symptoms: fails dead.
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title></title>
<!-- updated the jquery.min.js to the latest version -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>
</head>
<body>
<form action="#">
<div><input type="text" id="url" value="input a url" /></div>
<button class="button submit">
<img src="images/icons/tick.png" alt=""/> Get the feed
</button>
</form>
</body>
<script type="text/javascript">
$(document).ready(function() {
(function($){
$.fn.fire = function(url){
alert(url);
};
})(jQuery);
$(".button.submit").click(function ()
{
var url = $("#url").val();
fire(url);
});
});
</script>
</html>
Note: simplified version of this code.
Cheers