title: Undefined javascript function error
body: <p>I have made a simple javascript function that gets executed on button click -</p>
  
  <pre><code>&lt;asp:TextBox ID="TextBox3" runat="server" Width="98px"&gt;&lt;/asp:TextBox&gt;
  &lt;asp:Button ID="Button3" runat="server" Text="Button" OnClientClick="fn4();" /&gt;
  
  &lt;script  type="text/javascript"&gt;
  
  function fn4() 
  {
  
  var search = document.getElementById('TextBox3').value;
  
  &lt;iframe src="http://fooBar.com/q=" + search + " width="250" height="400" scrolling="no" frameborder="0"&gt;&lt;/iframe&gt;
  
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>So the <code>search</code> term is based on the user input from <code>TextBox3</code>, however when this is executed, it brings up the error -</p>
  
  <pre><code>Error: 'fn4' is undefined
  </code></pre>
  
  <p>How can I resolve this?</p>