I have A main page called index.php where I have a link like the below
<a href="bedview.php" target="main" onclick="javascript:showHideBedsNurse('JimAndersson')">Filter Person</a>
where main is an iframe like below.
<div id="middle" >
<iframe id="main" src="home.html">
</iframe>
</div>
The function called showHideBedsNurse(Name) looks like this
function showHideBedsNurse(Name){
$('.bedclass').hide();
alert("got Here");
}
Now to my question: it displays the alert message I.E it executes the function but the function Can't access the elements in bedview.php (So no classes called .bedclass are found and hidden). I want to state in the function to load the page bedview.php with all classes called .bedclass to be hidden and in this case show all the classes .JimAndersson I.E the parameter called Name.
Is this doable in an easy way? I'm currently stuck. The function works if I execute the function in bedview.php but not as I said if I execute it when loading the bedview.php from index.php.
And no I do not want it to load bedview.php with .bedclass hidden as default, only when clicking on this link and execute the function
Thanks in advance =)