I have this button in the backend of wordpress and if it is clicked it should change the content from a div in one file from my theme. I am probably very far away with my code from where I should be…
<input type="submit" value="load()" id="start_chat" /> //the button
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript">
$.ajaxSetup ({
cache: false
});
var loadUrl = "facut_mine3.php"; // the file where there is only a new content for the div #eu_la
$("#start_chat").click(function(){
$("#eu_la").load('http://www.fattorefamiglia.com/wp-content/themes/child_care_creative/layout_home_page2.php').html(loadUrl); //this is the file that I want to change, with the div #eu_la
});
</script>
Of course, nothing changes when I click the button. Is there any other way to do this?
To allow cross-domain Ajax requests set up an .htaccess file in the ROOT, containing following content:
Also see: