I have the contents of a php file downloaded via Ajax that contains HTML and JavaScript. I have a button:
<button class="search_button">Search</button>
And beneath it there is a script that will update hash documents from jQuery function
<script type="text/javascript">
$(".search_button").click(function() {
var searchTerm = $('#search_box').val();
document.location.hash="searchTerm";
return false;
});
</script>
This code works when I run the php file separately, but when loading this page from an Ajax call, the function no longer runs. There is no script in firebug, so I assume that I cannot load the script when using this method. I also tried adding a JavaScript snippet instead of the header for the entire website, but that also failed.
, , , , search_button, , ( Ajax) , '' .