(JQuery) Uncaught TypeError: Property ‘$’ of object [object someObject] is not a function

This can happen for instance when JQuery has not been fully loaded before trying to execute JQuery code.
Using $(document).ready(function($) is one way to solve this, as this should wait until JQuery is fully loaded.

<script type="text/javascript">
  $(document).ready(function($) {
    //some awsome jquery code
  });
</script>

Magento: Redirecting from inside a view

To redirect before headers are started to be sent (for instance from inside a controller) the following works:

Mage::app()->getFrontController()->getResponse()->setRedirect(Mage::getUrl('portal'));

This will redirect to the page called portal.

However if you try to do this from a view then you will get an error message about headers already having been sent.
If you need to do a redirect form inside a view then using javascript is one way to do this:

echo 'Due to SOMEREASON you are being redirected <a herf="' . Mage::getUrl('portal') . '">Please click here if nothing happens</a>';
		echo '<script type="text/javascript">
		<!--
		window.location = "' . Mage::getUrl('portal') . '"
		//-->
		</script>';

However a tip is to reconsider if you really need to do the redirect from the view, doing it from the controller is a lot easier and quicker.