title: load() in joomla to add part of form returns 404
body: <p>I am trying to use jQuery - AJAX load() Method to load part of registration form as a primitive protection against spam. I do not have experience with ajax and jquery in joomla and I suspect that is main problem here.</p>
  
  <p>I tried to modify existing default.php file of registration form with code from <a href="https://www.w3schools.com/jquery/jquery_ajax_load.asp" rel="nofollow noreferrer">https://www.w3schools.com/jquery/jquery_ajax_load.asp</a>. It does someting, but not what I want it to.
  Insted of loading separate file content that I set, it shows whole webpage in selected DIV with 404 error.
  Here is example in action:
  <a href="https://ambicij.si/2019/index.php/davki/seminar-davki-v-podjetjih-in-poudarek-na-dohodnini-obdavcitev-razlicnih-izplacil-zdoh-2/individual-registration" rel="nofollow noreferrer">https://ambicij.si/2019/index.php/davki/seminar-davki-v-podjetjih-in-poudarek-na-dohodnini-obdavcitev-razlicnih-izplacil-zdoh-2/individual-registration</a></p>
  
  <p>If you press "External Content" button it will show what I described. I would like to move submit buttons from DIV gumbi to external file so visitor will have to load buttons prior submiting form.
  Below is code I put into default.php</p>
  
  <pre><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script&gt;
      jQuery(document).ready(function(){
          jQuery("button").click(function(){
            jQuery("#gumbi").load("test.html", function(responseTxt, statusTxt, xhr){
             if(statusTxt == "success")
                 alert("External content loaded successfully!");
             if(statusTxt == "error")
                 alert("Error: " + xhr.status + ": " + xhr.statusText);
            });
          });
         });
  &lt;/script&gt; 
   &lt;button&gt;Get External Content&lt;/button&gt;
      &lt;div id="gumbi" class="form-actions"&gt;
          &lt;input type="button" class="&lt;?php echo $btnPrimary; ?&gt;" name="btnBack" value="&lt;?php echo  JText::_('EB_BACK') ;?&gt;" onclick="window.history.go(-1);" /&gt;
          &lt;input type="submit" class="&lt;?php echo $btnPrimary; ?&gt;" name="btn-submit" id="btn-submit" value="&lt;?php echo $buttonText;?&gt;" /&gt;
          &lt;img id="ajax-loading-animation" src="&lt;?php echo JUri::base(true);?&gt;/media/com_eventbooking/ajax-loadding-animation.gif" style="display: none;"/&gt;
  
      &lt;/div&gt;
  </code></pre>
  
  <p>and here is external test.html:</p>
  
  <pre><code>  &lt;html&gt;
      &lt;p&gt;test&lt;/p&gt;
    &lt;/html&gt;
  </code></pre>
  
  <p>As mentioned already, I would like to load code from test.html into div gumbi, but currently I get whole web page with 404 error. Since problem is not resolved, you can see it by following my link.</p>