我有一个包含嵌套框架集的文档。我需要访问名为“sq_main”的嵌套框架之一,并访问该框架内的内容。这是我的结构:
<html>
<head>
<title>Title</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<frameset rows="28,*" frameborder="0" border="0">
<frame src="/_admin/?SQ_BACKEND_PAGE=header" name="sq_header" scrolling="no" marginwidth="0" marginheight="0">
<frameset cols="380,10,*" frameborder="0" border="0" id ="main_frameset">
<frame src="/_admin/?SQ_BACKEND_PAGE=sidenav" name="sq_sidenav" scrolling="no" marginwidth="0" marginheight="0">
<frame src="/_admin/?SQ_BACKEND_PAGE=resizer" name="sq_resizer" scrolling="no" marginwidth="0" marginheight="0">
<frame src="/_admin?SQ_BACKEND_PAGE=main&assetid=43&sq_from_frontend=1" name="sq_main" marginwidth="0" marginheight="0" scrolling="yes">
</frameset>
</frameset>
<noframes></noframes>
</html>
遗憾的是,我无法更改代码,这就是我需要使用 jQuery 访问它的原因。我试图编写一个 jQuery 选择器来访问“sq_main”框架,但到目前为止还没有运气:
$('body', parent.frames[0].sq_main).prepend('<h1>TEST!!!!</h1>');
关于如何深入了解这个丑陋结构的想法?:)