Ask Question Forum:
Model Library:2025-02-08 Updated:A.I. model is online for auto reply question page
C
O
M
P
U
T
E
R
2
8
Show
#
ASK
RECENT
←
- Underline
- Bold
- Italic
- Indent
- Step
- Bullet
- Quote
- Cut
- Copy
- Paste
- Table
- Spelling
- Find & Replace
- Undo
- Redo
- Link
- Attach
- Clear
- Code
Below area will not be traslated by Google,you can input code or other languages
Hint:If find spelling error, You need to correct it,1 by 1 or ignore it (code area won't be checked).
X-position of the mouse cursor
Y-position of the mouse cursor
Y-position of the mouse cursor
Testcursor
caretPos
Attachment:===
Asked by duncanb7
at 2024-04-15 08:30:51
Point:500 Replies:10 POST_ID:828476USER_ID:11059
Topic:
JavaScript;;
I try test the $"('mainFrame').load() in Jquery with following javascript code for
testing whether the mainframe of frame is loaded and then falert box is coming out
for "frame window loaded" But it fail, only .ready alert box is coming for " frame document ready"
Why, whatis wrong with my code ? and I check firebug there is no any error
I have use before $(document).load() and $document).load() , it works fine but it will waiting
all three frame pages are loaded toegether the message abert will happen but I want
to check whether the specified frame window is load by $('#mainFram').load().
I already check the id and name of frame is same as "mainFrame"
Please advise
Duncan
testing whether the mainframe of frame is loaded and then falert box is coming out
for "frame window loaded" But it fail, only .ready alert box is coming for " frame document ready"
Why, whatis wrong with my code ? and I check firebug there is no any error
I have use before $(document).load() and $document).load() , it works fine but it will waiting
all three frame pages are loaded toegether the message abert will happen but I want
to check whether the specified frame window is load by $('#mainFram').load().
I already check the id and name of frame is same as "mainFrame"
Please advise
Duncan
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>jQuery demo</title> </head> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script><script type="text/javascript"> $('#mainFrame').ready(function() { alert(" frame document is ready");}); $('#mainFrame').load(function() { alert("frame window is loaded");});</script><frameset rows="45, 100,*" cols="*"><frame id="flashFrame" name="flashFrame" marginwidth=0 marginheight=0 frameborder="no" scrolling="NO" src="/kflash.html"><frame id="myFrame" name="topFrame" frameborder="no" scrolling="NO" src="/box.html"><script language="javascript"> document.getElementById("myFrame").noResize = true;</script><frame id="mainFrame" name="mainFrame" marginwidth=0 marginheight=0 src="http://www.mydomain.com/test.html" frameborder="no" ></frame></frameset></html> 1:2:3:4:5:6:7:8:9:10:11:12:13:14:15:16:17:18:19:20:21:22:23:24:25:26:27:28:29:30:31:32:33:34:
Author: duncanb7 replied at 2024-04-20 01:19:39
Thank for your reply,
it work for my website
for example
www.mywebsite.com
www.yahoo.com works
but it is not for all .html extentsion file for Jquery's load() such as www.mywebsite.com/test.html
Expert: roma1123 replied at 2024-04-16 04:24:12
<body onload=test()"> - there is an error here. it should be like this:
<body onload="test()">
also, note window.onload will throw errors in Firefox
<body onload="test()">
also, note window.onload will throw errors in Firefox
Author: duncanb7 replied at 2024-04-15 13:16:08
but it is same for window.onload..
So in my test.html is nothing insdie beside those tag and html and body ,div etc.
So in my test.html is nothing insdie beside those tag and html and body ,div etc.
Author: duncanb7 replied at 2024-04-15 13:06:19
<body onload=test()">, it might be problem here on onload because I delete all fucntion running in test() function.
So I might switch to window.onload to see any help
So I might switch to window.onload to see any help
Author: duncanb7 replied at 2024-04-15 12:37:14
Even I quit the firefox and try again becasue of Cahce issue, but it is same
Author: duncanb7 replied at 2024-04-15 12:36:32
there is no any bug from firebug I have checked many times
No alert message for frame widnow is in FIrefox, IE, Safari.
So I believe it is related to the xmlhttp.request. Any suggestion
No alert message for frame widnow is in FIrefox, IE, Safari.
So I believe it is related to the xmlhttp.request. Any suggestion
Expert: roma1123 replied at 2024-04-15 12:34:07
you most probably have an javascript error on test.html page which is preventing your alert to appear.
Check that page for javascript errors.
Check that page for javascript errors.
Author: duncanb7 replied at 2024-04-15 12:28:27
Alert message for frame window is coming out for www.yahoo.com but not for my test.html, Why ?
Accepted Solution
Author: duncanb7 replied at 2024-04-15 12:23:27
You are right,
When it go to other website , it work correctly such as www.yahoo.com
<frame id="mainFrame" name="mainFrame" marginwidth=0 marginheight=0 src="http://www.yahoo.com" frameborder="no" >
But for my test.html the alert("frame windows is loaded") is NOT coming out even I have seen
all page is loaded.
In test.html is extract a table from using xmlhttp to open a csv file and then use string.push to
do a string and put it the tag id by getelementby id<"div"). even I change the size of table to be 1*1 that
is no alert message box for frame window is loaded. Please review my code.. Is it Jquery confict to
xmlhttp request ? Everything is loaded and table is well done but no alert message for frame window
Please advise
Duncan
When it go to other website , it work correctly such as www.yahoo.com
<frame id="mainFrame" name="mainFrame" marginwidth=0 marginheight=0 src="http://www.yahoo.com" frameborder="no" >
But for my test.html the alert("frame windows is loaded") is NOT coming out even I have seen
all page is loaded.
In test.html is extract a table from using xmlhttp to open a csv file and then use string.push to
do a string and put it the tag id by getelementby id<"div"). even I change the size of table to be 1*1 that
is no alert message box for frame window is loaded. Please review my code.. Is it Jquery confict to
xmlhttp request ? Everything is loaded and table is well done but no alert message for frame window
Please advise
Duncan
function getData( url ,k){var xmlhttp;if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); }else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function() { if ( xmlhttp.readyState == 4 ) { // alert("Waiting render"); inner2( xmlhttp.responseText );//alert("render finsh"); } } xmlhttp.open( "GET", url, true ); xmlhttp.send( null );}function inner2(data){ var y=0; var k=123;var dataRows = data.split( "" ); removeTable(); var time1 = new Date().getTime(); var string = new Array(); string.push('<table>');//string.push(''); columnwidth(string); string.push('<tbody>');try { for (var i=0;i<1;i++) { var dataCells = dataRows[i].split(","); string.push('<tr>'); for (var j=0;j<dataCells.length; j++) { y='<td>'+ dataCells[j] + '</td>'; //string.push('<td>*</td>'); //string.push('<td>12</td>'); //string.push('</td>'); string.push(y); } string.push('</tr>'); } }catch(err) {} string.push('</tbody></table>'); var writestring = string.join(''); document.getElementById('writeroot').innerHTML = writestring; //var time2 = new Date().getTime(); //doTiming(5,time1,time2); columnstyle();}function test () { getData("http://www.mywebsite/javascript.csv?r=1264",0 );}// --></script><body onload=test()"><div id=writeroot" ></div></body></div> 1:2:3:4:5:6:7:8:9:10:11:12:13:14:15:16:17:18:19:20:21:22:23:24:25:26:27:28:29:30:31:32:33:34:35:36:37:38:39:40:41:42:43:44:45:46:47:48:49:50:51:52:53:54:55:56:57:58:59:60:61:62:63:64:65:66:67:68:69:70:71:72:73:74:
Assisted Solution
Expert: roma1123 replied at 2024-04-15 11:10:06
500 points EXCELLENT
I think your frame has not yet loaded and you must attach load event inisde a .ready();. Like this:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>jQuery demo</title> </head> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script><script type="text/javascript"> $('#mainFrame').ready(function() { alert(" frame document is ready"); $('#mainFrame').load(function() { alert("frame window is loaded"); });});</script><frameset rows="45, 100,*" cols="*"><frame id="flashFrame" name="flashFrame" marginwidth=0 marginheight=0 frameborder="no" scrolling="NO" src="/kflash.html"><frame id="myFrame" name="topFrame" frameborder="no" scrolling="NO" src="/box.html"><script language="javascript"> document.getElementById("myFrame").noResize = true;</script><frame id="mainFrame" name="mainFrame" marginwidth=0 marginheight=0 src="http://www.mydomain.com/test.html" frameborder="no" ></frame></frameset></html> 1:2:3:4:5:6:7:8:9:10:11:12:13:14:15:16:17:18:19:20:21:22:23:24:25:26:27:28:29:30:31:32:33:34:35:36: