Simple question regarding functions in jQuery

Simple question regarding functions in jQuery

Hello guys,

It's my first time here, so hopefully I don't get eaten or something :)

I've ran into a little problem when using resize() function in jQuery as I am trying to call a function after the document loads and later on should window resize occur, but I can't really figure out use jQuery syntax to do the both at the same time within a function. Here's a example:

  1. $(document).ready(function() {
  2. doScript();
  3. $(window).resize(function doScript() {
  4. // do stuff
  5. });
  6. });
So it is possible to give an instance name to this (resize) function and call it just once after the page loads?