title: Issue with Jquery load functionality
body: <p>I am trying to run the Page with Jquery Functionality insside it, what is happening when i do the ajax POSt, it shows me the message successfully in an alert box and afterwards it reloads the whole page again and then it is unable to run again and at point it shows error like </p>
  
  <pre><code>$fancybox in undefined, sometimes it shows t is undefined
  </code></pre>
  
  <p>but other functionality like update the page again does not work. Here is the below code i tried </p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;View Images&lt;/title&gt;
  &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="/js/fancybox/jquery.fancybox-1.3.4.pack.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="/js/fancybox/jquery.easing-1.3.pack.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="/js/fancybox/jquery.mousewheel-3.0.4.pack.js"&gt;&lt;/script&gt;
  &lt;link rel="stylesheet" type="text/css" href="/js/fancybox/jquery.fancybox-1.3.4.css"&gt;
  &lt;script type="text/javascript"&gt;
  $(document).ready(function() {
      $("a.zoom2").fancybox({
          'zoomSpeedIn'     :500,
          'zoomSpeedOut'   :500,
          'overlayShow'     :false,
          'width'         :800,
          'height'           :600
      });
  
      $(".mychecks").click(function(e) {
          var data = $("#frmImages").serialize();
          var mainID = $("#mainID").val();
          $.ajax({
              type:"POST",
              url:"actionImages.cfm?action=update",
              cache:false,
              data:data,
              success:function(html) {            
                  var i = $("#msg").html(html).text().replace('/\s+/g', ' ');
                  alert(i);
                  $('#reloadImages').load('viewImages.cfm?ID=' + mainID + '&amp;user=myname');                
              }
          });
      });
  });
  function checkboxes(theElement) {
      var theForm = theElement.form, z = 0;
          for(z=0; z&lt;theForm.length;z++){
          if(theForm[z].type == 'checkbox' &amp;&amp; theForm[z].name != 'checkall'){
          theForm[z].checked = theElement.checked;
          }
      }
  } 
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body style="background:white;"&gt;
  &lt;div id="reloadImages"&gt;
    &lt;form name="frmImages" id="frmImages"&gt;
      &lt;table align="center" width="100%" cellpadding="1" cellspacing="2"&gt;
        &lt;tr&gt;
          &lt;td colspan="4" align="center"&gt;&lt;div style="display:none;" id="msg"&gt;&lt;/div&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;td colspan="4" align="left" class="BlackBold20"&gt;&lt;strong&gt;View Images&lt;/strong&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;td height="30" valign="middle" class="dropdownb"&gt;&lt;a class="zoom2" rel="group" title="Bigger Image" 
              href="/small/5643-Freshy_FRESH_OVAL_OVAL.jpg"&gt; &lt;IMG src="/small/5643.jpg" border='0'&gt;&lt;/a&gt;&lt;br&gt;
            &lt;a title="Delete this Image - 5643.jpg" style="cursor:pointer;" id="Del~47780~5643" class="del"&gt;[X]&lt;/a&gt;&amp;nbsp;&amp;nbsp; &lt;br&gt;
            Show Image:  
            Yes
            &lt;input type="radio" name="display_47780" id="display_1_47780" checked="checked" value="1" title="Check this Radio to show the image on front screen"&gt;
            &amp;nbsp;&amp;nbsp; 
            No
            &lt;input type="radio" name="display_47780" id="display_0_47780"  value="0" title="Check this Radio to not show the image on front screen"&gt;
            &lt;br&gt;
            &lt;br&gt;
            &lt;select name="submitter_47780" id="submitter_47780"&gt;
              &lt;option value="none" selected="selected"&gt;(Select One)...&lt;/option&gt;
              &lt;option value="cDM" selected="selected"&gt;cDM&lt;/option&gt;
            &lt;/select&gt;
            &lt;br&gt;
            Header Image&amp;nbsp;&amp;nbsp;
            &lt;select name="headerImage_47780" id="headerImage_47780"&gt;
              &lt;option value="0" &gt;No&lt;/option&gt;
              &lt;option value="1" selected="selected"&gt;Yes&lt;/option&gt;
            &lt;/select&gt;&lt;/td&gt;
          &lt;td height="30" valign="middle" class="dropdownb"&gt;&lt;a class="zoom2" rel="group" title="Bigger Image" 
              href="/small/5643-Chrysanthemum_13D4294A55.jpg"&gt; &lt;IMG src="/small/5643-Chrysanthemum_13D4294A55.jpg" border='0'&gt;&lt;/a&gt;&lt;br&gt;
            &lt;a title="Delete this Image - 5643-Chrysanthemum_13D4294A55.jpg" style="cursor:pointer;" id="Del~47787~5643" class="del"&gt;[X]&lt;/a&gt;&amp;nbsp;&amp;nbsp; &lt;br&gt;
            Show Image:  
            Yes
            &lt;input type="radio" name="display_47787" id="display_1_47787" checked="checked" value="1" title="Check this Radio to show the image on front screen"&gt;
            &amp;nbsp;&amp;nbsp; 
            No
            &lt;input type="radio" name="display_47787" id="display_0_47787"  value="0" title="Check this Radio to not show the image on front screen"&gt;
            &lt;br&gt;
            &lt;br&gt;
            &lt;select name="submitter_47787" id="submitter_47787"&gt;
              &lt;option value="none" selected="selected"&gt;(Select One)...&lt;/option&gt;
              &lt;option value="cDM" selected="selected"&gt;cDM&lt;/option&gt;
            &lt;/select&gt;
            &lt;br&gt;
            Header Image&amp;nbsp;&amp;nbsp;
            &lt;select name="headerImage_47787" id="headerImage_47787"&gt;
              &lt;option value="0" selected="selected"&gt;No&lt;/option&gt;
              &lt;option value="1" &gt;Yes&lt;/option&gt;
            &lt;/select&gt;&lt;/td&gt;
          &lt;td height="30" valign="middle" class="dropdownb"&gt;&lt;a class="zoom2" rel="group" title="Bigger Image" 
              href="/small/5643-Desert_73A8B513FA.jpg"&gt; &lt;IMG src="/small/5643-Desert_73A8B513FA.jpg" border='0'&gt;&lt;/a&gt;&lt;br&gt;
            &lt;a title="Delete this Image - 5643-Desert_73A8B513FA.jpg" style="cursor:pointer;" id="Del~47788~5643" class="del"&gt;[X]&lt;/a&gt;&amp;nbsp;&amp;nbsp; &lt;br&gt;
            Show Image:  
            Yes
            &lt;input type="radio" name="display_47788" id="display_1_47788" checked="checked" value="1" title="Check this Radio to show the image on front screen"&gt;
            &amp;nbsp;&amp;nbsp; 
            No
            &lt;input type="radio" name="display_47788" id="display_0_47788"  value="0" title="Check this Radio to not show the image on front screen"&gt;
            &lt;br&gt;
            &lt;br&gt;
            &lt;select name="submitter_47788" id="submitter_47788"&gt;
              &lt;option value="none" selected="selected"&gt;(Select One)...&lt;/option&gt;
              &lt;option value="cDM" selected="selected"&gt;cDM&lt;/option&gt;
            &lt;/select&gt;
            &lt;br&gt;
            Header Image&amp;nbsp;&amp;nbsp;
            &lt;select name="headerImage_47788" id="headerImage_47788"&gt;
              &lt;option value="0" selected="selected"&gt;No&lt;/option&gt;
              &lt;option value="1" &gt;Yes&lt;/option&gt;
            &lt;/select&gt;&lt;/td&gt;
          &lt;td height="30" valign="middle" class="dropdownb"&gt;&lt;a class="zoom2" rel="group" title="Bigger Image" 
              href="/small/5643-Hydrangeas_B1AE8A300E.jpg"&gt; &lt;IMG src="/small/5643-Hydrangeas_B1AE8A300E.jpg" border='0'&gt;&lt;/a&gt;&lt;br&gt;
            &lt;a title="Delete this Image - 5643-Hydrangeas_B1AE8A300E.jpg" style="cursor:pointer;" id="Del~47789~5643" class="del"&gt;[X]&lt;/a&gt;&amp;nbsp;&amp;nbsp; &lt;br&gt;
            Show Image:  
            Yes
            &lt;input type="radio" name="display_47789" id="display_1_47789" checked="checked" value="1" title="Check this Radio to show the image on front screen"&gt;
            &amp;nbsp;&amp;nbsp; 
            No
            &lt;input type="radio" name="display_47789" id="display_0_47789"  value="0" title="Check this Radio to not show the image on front screen"&gt;
            &lt;br&gt;
            &lt;br&gt;
            &lt;select name="submitter_47789" id="submitter_47789"&gt;
              &lt;option value="none" selected="selected"&gt;(Select One)...&lt;/option&gt;
              &lt;option value="cDM" selected="selected"&gt;cDM&lt;/option&gt;
            &lt;/select&gt;
            &lt;br&gt;
            Header Image&amp;nbsp;&amp;nbsp;
            &lt;select name="headerImage_47789" id="headerImage_47789"&gt;
              &lt;option value="0" selected="selected"&gt;No&lt;/option&gt;
              &lt;option value="1" &gt;Yes&lt;/option&gt;
            &lt;/select&gt;&lt;/td&gt;
          &lt;span class="dropdownb"&gt;
          &lt;/tr&gt;
          &lt;/span&gt;
          &lt;td height="30" valign="middle" class="dropdownb"&gt;&lt;a class="zoom2" rel="group" title="Bigger Image" 
              href="/small/5643-Jellyfish_BFEB8F8D8F.jpg"&gt; &lt;IMG src="/small/5643-Jellyfish_BFEB8F8D8F.jpg" border='0'&gt;&lt;/a&gt;&lt;br&gt;
            &lt;a title="Delete this Image - 5643-Jellyfish_BFEB8F8D8F.jpg" style="cursor:pointer;" id="Del~47790~5643" class="del"&gt;[X]&lt;/a&gt;&amp;nbsp;&amp;nbsp; &lt;br&gt;
            Show Image:  
            Yes
            &lt;input type="radio" name="display_47790" id="display_1_47790" checked="checked" value="1" title="Check this Radio to show the image on front screen"&gt;
            &amp;nbsp;&amp;nbsp; 
            No
            &lt;input type="radio" name="display_47790" id="display_0_47790"  value="0" title="Check this Radio to not show the image on front screen"&gt;
            &lt;br&gt;
            &lt;br&gt;
            &lt;select name="submitter_47790" id="submitter_47790"&gt;
              &lt;option value="none" selected="selected"&gt;(Select One)...&lt;/option&gt;
              &lt;option value="cDM" &gt;cDM&lt;/option&gt;
            &lt;/select&gt;
            &lt;br&gt;
            Header Image&amp;nbsp;&amp;nbsp;
            &lt;select name="headerImage_47790" id="headerImage_47790"&gt;
              &lt;option value="0" selected="selected"&gt;No&lt;/option&gt;
              &lt;option value="1" &gt;Yes&lt;/option&gt;
            &lt;/select&gt;&lt;/td&gt;
          &lt;td height="30" valign="middle" class="dropdownb"&gt;&lt;a class="zoom2" rel="group" title="Bigger Image" 
              href="/small/5643-Koala_3BF9D36D8F.jpg"&gt; &lt;IMG src="/small/5643-Koala_3BF9D36D8F.jpg" border='0'&gt;&lt;/a&gt;&lt;br&gt;
            &lt;a title="Delete this Image - 5643-Koala_3BF9D36D8F.jpg" style="cursor:pointer;" id="Del~47791~5643" class="del"&gt;[X]&lt;/a&gt;&amp;nbsp;&amp;nbsp; &lt;br&gt;
            Show Image:  
            Yes
            &lt;input type="radio" name="display_47791" id="display_1_47791" checked="checked" value="1" title="Check this Radio to show the image on front screen"&gt;
            &amp;nbsp;&amp;nbsp; 
            No
            &lt;input type="radio" name="display_47791" id="display_0_47791"  value="0" title="Check this Radio to not show the image on front screen"&gt;
            &lt;br&gt;
            &lt;br&gt;
            &lt;select name="submitter_47791" id="submitter_47791"&gt;
              &lt;option value="none" selected="selected"&gt;(Select One)...&lt;/option&gt;
              &lt;option value="cDM" selected="selected"&gt;cDM&lt;/option&gt;
            &lt;/select&gt;
            &lt;br&gt;
            Header Image&amp;nbsp;&amp;nbsp;
            &lt;select name="headerImage_47791" id="headerImage_47791"&gt;
              &lt;option value="0" selected="selected"&gt;No&lt;/option&gt;
              &lt;option value="1" &gt;Yes&lt;/option&gt;
            &lt;/select&gt;&lt;/td&gt;
          &lt;td height="30" valign="middle" class="dropdownb"&gt;&lt;a class="zoom2" rel="group" title="Bigger Image" 
              href="/small/5643-lamborghini-82a_05F51070AB.jpg"&gt; &lt;IMG src="/small/5643-lamborghini-82a_05F51070AB.jpg" border='0'&gt;&lt;/a&gt;&lt;br&gt;
            &lt;a title="Delete this Image - 5643-lamborghini-82a_05F51070AB.jpg" style="cursor:pointer;" id="Del~47792~5643" class="del"&gt;[X]&lt;/a&gt;&amp;nbsp;&amp;nbsp; &lt;br&gt;
            Show Image:  
            Yes
            &lt;input type="radio" name="display_47792" id="display_1_47792" checked="checked" value="1" title="Check this Radio to show the image on front screen"&gt;
            &amp;nbsp;&amp;nbsp; 
            No
            &lt;input type="radio" name="display_47792" id="display_0_47792"  value="0" title="Check this Radio to not show the image on front screen"&gt;
            &lt;br&gt;
            &lt;br&gt;
            &lt;select name="submitter_47792" id="submitter_47792"&gt;
              &lt;option value="none" selected="selected"&gt;(Select One)...&lt;/option&gt;
              &lt;option value="cDM" &gt;cDM&lt;/option&gt;
            &lt;/select&gt;
            &lt;br&gt;
            Header Image&amp;nbsp;&amp;nbsp;
            &lt;select name="headerImage_47792" id="headerImage_47792"&gt;
              &lt;option value="0" selected="selected"&gt;No&lt;/option&gt;
              &lt;option value="1" &gt;Yes&lt;/option&gt;
            &lt;/select&gt;&lt;/td&gt;
          &lt;td height="30" valign="middle" class="dropdownb"&gt;&lt;a class="zoom2" rel="group" title="Bigger Image" 
              href="/small/5643-Lighthouse_5D01293FFF.jpg"&gt; &lt;IMG src="/small/5643-Lighthouse_5D01293FFF.jpg" border='0'&gt;&lt;/a&gt;&lt;br&gt;
            &lt;a title="Delete this Image - 5643-Lighthouse_5D01293FFF.jpg" style="cursor:pointer;" id="Del~47793~5643" class="del"&gt;[X]&lt;/a&gt;&amp;nbsp;&amp;nbsp; &lt;br&gt;
            Show Image:  
            Yes
            &lt;input type="radio" name="display_47793" id="display_1_47793" checked="checked" value="1" title="Check this Radio to show the image on front screen"&gt;
            &amp;nbsp;&amp;nbsp; 
            No
            &lt;input type="radio" name="display_47793" id="display_0_47793"  value="0" title="Check this Radio to not show the image on front screen"&gt;
            &lt;br&gt;
            &lt;br&gt;
            &lt;select name="submitter_47793" id="submitter_47793"&gt;
              &lt;option value="none" selected="selected"&gt;(Select One)...&lt;/option&gt;
              &lt;option value="cDM" &gt;cDM&lt;/option&gt;
            &lt;/select&gt;
            &lt;br&gt;
            Header Image&amp;nbsp;&amp;nbsp;
            &lt;select name="headerImage_47793" id="headerImage_47793"&gt;
              &lt;option value="0" selected="selected"&gt;No&lt;/option&gt;
              &lt;option value="1" &gt;Yes&lt;/option&gt;
            &lt;/select&gt;&lt;/td&gt;
          &lt;span class="dropdownb"&gt;
          &lt;/tr&gt;
          &lt;/span&gt;
          &lt;td height="30" valign="middle" class="dropdownb"&gt;&lt;a class="zoom2" rel="group" title="Bigger Image" 
              href="/small/5643-Penguins1_714BCABE16.jpg"&gt; &lt;IMG src="/small/5643-Penguins1_714BCABE16.jpg" border='0'&gt;&lt;/a&gt;&lt;br&gt;
            &lt;a title="Delete this Image - 5643-Penguins1_714BCABE16.jpg" style="cursor:pointer;" id="Del~47794~5643" class="del"&gt;[X]&lt;/a&gt;&amp;nbsp;&amp;nbsp; &lt;br&gt;
            Show Image:  
            Yes
            &lt;input type="radio" name="display_47794" id="display_1_47794" checked="checked" value="1" title="Check this Radio to show the image on front screen"&gt;
            &amp;nbsp;&amp;nbsp; 
            No
            &lt;input type="radio" name="display_47794" id="display_0_47794"  value="0" title="Check this Radio to not show the image on front screen"&gt;
            &lt;br&gt;
            &lt;br&gt;
            &lt;select name="submitter_47794" id="submitter_47794"&gt;
              &lt;option value="none" selected="selected"&gt;(Select One)...&lt;/option&gt;
              &lt;option value="cDM" selected="selected"&gt;cDM&lt;/option&gt;
            &lt;/select&gt;
            &lt;br&gt;
            Header Image&amp;nbsp;&amp;nbsp;
            &lt;select name="headerImage_47794" id="headerImage_47794"&gt;
              &lt;option value="0" selected="selected"&gt;No&lt;/option&gt;
              &lt;option value="1" &gt;Yes&lt;/option&gt;
            &lt;/select&gt;&lt;/td&gt;
          &lt;td height="30" valign="middle" class="dropdownb"&gt;&lt;a class="zoom2" rel="group" title="Bigger Image" 
              href="/small/5643-sameera-reddy-77a_1C7F77BE41.jpg"&gt; &lt;IMG src="/small/5643-sameera-reddy-77a_1C7F77BE41.jpg" border='0'&gt;&lt;/a&gt;&lt;br&gt;
            &lt;a title="Delete this Image - 5643-sameera-reddy-77a_1C7F77BE41.jpg" style="cursor:pointer;" id="Del~47795~5643" class="del"&gt;[X]&lt;/a&gt;&amp;nbsp;&amp;nbsp; &lt;br&gt;
            Show Image:  
            Yes
            &lt;input type="radio" name="display_47795" id="display_1_47795" checked="checked" value="1" title="Check this Radio to show the image on front screen"&gt;
            &amp;nbsp;&amp;nbsp; 
            No
            &lt;input type="radio" name="display_47795" id="display_0_47795"  value="0" title="Check this Radio to not show the image on front screen"&gt;
            &lt;br&gt;
            &lt;br&gt;
            &lt;select name="submitter_47795" id="submitter_47795"&gt;
              &lt;option value="none" selected="selected"&gt;(Select One)...&lt;/option&gt;
              &lt;option value="cDM" selected="selected"&gt;cDM&lt;/option&gt;
            &lt;/select&gt;
            &lt;br&gt;
            Header Image&amp;nbsp;&amp;nbsp;
            &lt;select name="headerImage_47795" id="headerImage_47795"&gt;
              &lt;option value="0" selected="selected"&gt;No&lt;/option&gt;
              &lt;option value="1" &gt;Yes&lt;/option&gt;
            &lt;/select&gt;&lt;/td&gt;
          &lt;td height="30" valign="middle" class="dropdownb"&gt;&lt;a class="zoom2" rel="group" title="Bigger Image" 
              href="/small/5643-Tulips_F832F5324B.jpg"&gt; &lt;IMG src="/small/5643-Tulips_F832F5324B.jpg" border='0'&gt;&lt;/a&gt;&lt;br&gt;
            &lt;a title="Delete this Image - 5643-Tulips_F832F5324B.jpg" style="cursor:pointer;" id="Del~47796~5643" class="del"&gt;[X]&lt;/a&gt;&amp;nbsp;&amp;nbsp; &lt;br&gt;
            Show Image:  
            Yes
            &lt;input type="radio" name="display_47796" id="display_1_47796" checked="checked" value="1" title="Check this Radio to show the image on front screen"&gt;
            &amp;nbsp;&amp;nbsp; 
            No
            &lt;input type="radio" name="display_47796" id="display_0_47796"  value="0" title="Check this Radio to not show the image on front screen"&gt;
            &lt;br&gt;
            &lt;br&gt;
            &lt;select name="submitter_47796" id="submitter_47796"&gt;
              &lt;option value="none" selected="selected"&gt;(Select One)...&lt;/option&gt;
              &lt;option value="cDM" &gt;cDM&lt;/option&gt;
            &lt;/select&gt;
            &lt;br&gt;
            Header Image&amp;nbsp;&amp;nbsp;
            &lt;select name="headerImage_47796" id="headerImage_47796"&gt;
              &lt;option value="0" selected="selected"&gt;No&lt;/option&gt;
              &lt;option value="1" &gt;Yes&lt;/option&gt;
            &lt;/select&gt;&lt;/td&gt;
          &lt;input type="hidden" name="mainID" value="5643" id="mainID"&gt;
          &lt;input type="hidden" name="updmode" id="updmode" value="codes"&gt;
        &lt;tr&gt;
          &lt;td colspan="4" align="left"&gt;&lt;input type="button" name="Update" value="Update" class="mychecks" &gt;&lt;/td&gt;
        &lt;/tr&gt;
      &lt;/table&gt;
    &lt;/form&gt;
  &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>