It has been many years since I last typed <frameset>
into my editor, but today I find myself doing just that.
I'm writing a small tool that makes use of frames. In one frame I have a document with a text input, and in another frame I have a <ul>
of items. When I type in the text field in one frame, I need to show/hide items from the <ul>
in the other frame. Historically I recall this would work fine. But trying it today, Chrome is throwing a wobbler:
Unsafe JavaScript attempt to access frame with URL file://localhost/Users/chris/multi_yardoc/projects/list.html from frame with URL file://localhost/Users/chris/multi_yardoc/projects/menu.html. Domains, protocols and ports must match.
<script>
$(document).ready(function() {
$("#search-box").bind("keyup", function() {
$("li[class*='object-']", top.frames["list"].document).hide();
$("li[class*='object-" + $(this).val() + "']", top.frames["list"].document).show();
});
});
</script>
The error makes no sense to me, as the domain, protocol and port all match. How do I achieve this?