Asked by duncanb7
at 2024-04-15 14:40:59
Point:500 Replies:6 POST_ID:828477USER_ID:11059
Topic:
JavaScript;;Hypertext Markup Language (HTML)
I try use to Jquery's load() fucntion to alert the web page loaded is completed or not in frame
, just see the following example code attached in core area
The code work fine for all domain site , for example , http://www.yahoo.com putting in third frame
<frame id="mainFrame" name="mainFrame" marginwidth=0 marginheight=0 src="http://www.yahoo.com" frameborder="no" ></frame>
</frameset>
Two alert message boxes are coming out for "frame document is ready " and "frame window is loaded"
But if I put my html file at src =http://www.mywebiste.com/test.html in the same thrid frame of "mainFrame",
it work only for .ready function but it doesn't work for load(), only one alert message box is coming for "frame
document is ready" , even I change to other my html file and it is also same result. So I suspect Jquery load()
function is only checked for index page of domain in frame and not for file with html extentsion. Is it Right ?
Please advise
Duncan
, just see the following example code attached in core area
The code work fine for all domain site , for example , http://www.yahoo.com putting in third frame
<frame id="mainFrame" name="mainFrame" marginwidth=0 marginheight=0 src="http://www.yahoo.com" frameborder="no" ></frame>
</frameset>
Two alert message boxes are coming out for "frame document is ready " and "frame window is loaded"
But if I put my html file at src =http://www.mywebiste.com/test.html in the same thrid frame of "mainFrame",
it work only for .ready function but it doesn't work for load(), only one alert message box is coming for "frame
document is ready" , even I change to other my html file and it is also same result. So I suspect Jquery load()
function is only checked for index page of domain in frame and not for file with html extentsion. Is it Right ?
Please advise
Duncan
Author: duncanb7 replied at 2024-04-20 07:47:13
I tried this before and it fail and so people ask to change it as follows
<script type="text/javascript">
$('#mainFrame').ready(function() {
alert("frame document is ready");
$('#mainFrame').load(function() {
alert("frame window is loaded");
});
});
</script>
<script type="text/javascript">
$('#mainFrame').ready(function() {
alert("frame document is ready");
$('#mainFrame').load(function() {
alert("frame window is loaded");
});
});
</script>
Assisted Solution
Expert: khan_webguru replied at 2024-04-19 01:10:03
166 points GOOD
Put this code in head section of your HTML file
And then add this HTML page on other page as frame and see the result hope you will get desire result.
Thanks,
Asif Ahmed Khan
Accepted Solution
Expert: leakim971 replied at 2024-04-16 05:16:06
167 points GOOD