I'm struggling on this question for whole day, so maybe someone could help.
I want to load settings.php page, which includes javascript/jquery code with usual html, into index.php on button click.
Here are the code snippets:
Index.php
<head>
<script type="text/javascript">
function loadSettingsPage (){
$('#myResults').load('settings.php', function (){ });
}
</script>
</head>
Settings.php
<div class="tabsWrapper">
<ul class="tabs">
<li data="sections" onclick="setTab('sections')">Product categories</li>
<li data="suppliers" onclick="setTab('suppliers')">Suppliers</li>
</ul>
</div>
...
<script type="text/javascript">
function setTab(currentTab = "sections"){
//some code goes here
};
$(document).ready(function (){
//document ready code goes here with click events
}
</script>
The question is, how to load/include Settings.php file into index.php file so that all javascript code included click events in $(document).ready function is executed in safari browser as well. Now it works perfectly with all browsers but safari.
include('settings.php')inside of your HTML myResults element.