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-11-13 03:50:41
Point:500 Replies:9 POST_ID:828423USER_ID:11059
Topic:
JavaScript;;Asynchronous Javascript and XML (AJAX)
I am using frame and frameset for my wbepage. Suing frame1 to redirect second frame's URL
My question is
how to align body of second frame to its frame top and left I ty this in first fram's html but
it doesn't work, only redirect to www.yahoo.com is successful. Is it any snytax issue ?
parent.secondframename.document.location.href="http://www.yahoo.com";
parent.secondframename.document.body.style.marginTop='0';
parent.secondframename.document.body.style.marginLeft='0';
My question is
how to align body of second frame to its frame top and left I ty this in first fram's html but
it doesn't work, only redirect to www.yahoo.com is successful. Is it any snytax issue ?
parent.secondframename.document.location.href="http://www.yahoo.com";
parent.secondframename.document.body.style.marginTop='0';
parent.secondframename.document.body.style.marginLeft='0';
Attachment:Snap20.jpg
Author: duncanb7 replied at 2024-03-07 08:16:36
it is soved yesterday after I put it marginwidth/height in frame tage in Excel sheet
<frame src="" name="frScroll" marginwidth=0 marginheight=0 scrolling=no>"+
But the question, I have 1000 Excel files for production data, I add it in Excel sheet.htm that will
create future problem or slow down file dowload time since need to do open
and insertion of margin code and close.
So I prefer to solve it in main/index html , It might be delay time problem at A point, the link is not ready yet second frame
style.marginTop in fuction is already done and once rediectlink is ready, excelsheet0001's frame tag will
override it. So Probaby using xmlhtttp.statue to set do loop condition for checking redirect link readystate
will solve the issue
--------------------------------------------
Function inputboxRedirectURL() {
parent.secondframename.document.location.href="http://www.mywebsite.com/excelsheet001.htm";
-----------------A point
parent.secondframename.document.body.style.marginTop='0';
parent.secondframename.document.body.style.marginLeft='0'; }
<frame src="" name="frScroll" marginwidth=0 marginheight=0 scrolling=no>"+
But the question, I have 1000 Excel files for production data, I add it in Excel sheet.htm that will
create future problem or slow down file dowload time since need to do open
and insertion of margin code and close.
So I prefer to solve it in main/index html , It might be delay time problem at A point, the link is not ready yet second frame
style.marginTop in fuction is already done and once rediectlink is ready, excelsheet0001's frame tag will
override it. So Probaby using xmlhtttp.statue to set do loop condition for checking redirect link readystate
will solve the issue
--------------------------------------------
Function inputboxRedirectURL() {
parent.secondframename.document.location.href="http://www.mywebsite.com/excelsheet001.htm";
-----------------A point
parent.secondframename.document.body.style.marginTop='0';
parent.secondframename.document.body.style.marginLeft='0'; }
Author: duncanb7 replied at 2024-11-14 01:48:30
it is soved yesterday after I put it marginwidth/height in frame tage in Excel sheet
<frame src="" name="frScroll" marginwidth=0 marginheight=0 scrolling=no>"+
But the question, I have 1000 Excel files for production data, I add it in Excel sheet.htm that will
create future problem or slow down file dowload time since need to do open
and insertion of margin code and close.
So I prefer to solve it in main/index html , It might be delay time problem at A point, the link is not ready yet second frame
style.marginTop in fuction is already done and once rediectlink is ready, excelsheet0001's frame tag will
override it. So Probaby using xmlhtttp.statue to set do loop condition for checking redirect link readystate
will solve the issue
--------------------------------------------
Function inputboxRedirectURL() {
parent.secondframename.document.location.href="http://www.mywebsite.com/excelsheet001.htm";
-----------------A point
parent.secondframename.document.body.style.marginTop='0';
parent.secondframename.document.body.style.marginLeft='0'; }
<frame src="" name="frScroll" marginwidth=0 marginheight=0 scrolling=no>"+
But the question, I have 1000 Excel files for production data, I add it in Excel sheet.htm that will
create future problem or slow down file dowload time since need to do open
and insertion of margin code and close.
So I prefer to solve it in main/index html , It might be delay time problem at A point, the link is not ready yet second frame
style.marginTop in fuction is already done and once rediectlink is ready, excelsheet0001's frame tag will
override it. So Probaby using xmlhtttp.statue to set do loop condition for checking redirect link readystate
will solve the issue
--------------------------------------------
Function inputboxRedirectURL() {
parent.secondframename.document.location.href="http://www.mywebsite.com/excelsheet001.htm";
-----------------A point
parent.secondframename.document.body.style.marginTop='0';
parent.secondframename.document.body.style.marginLeft='0'; }
Expert: elliottbrooks replied at 2024-11-13 14:48:27
Is this online - have you got a link I could take a look at?
Accepted Solution
Expert: elliottbrooks replied at 2024-11-13 14:43:59
500 points GOOD
It may be worth inserting a style tag into the header of the excel HTML file itself.
Try the following code, it'll show you all the individual elements of the page and should help pinpoint which bit is causing the mysterious margin/padding...
Try the following code, it'll show you all the individual elements of the page and should help pinpoint which bit is causing the mysterious margin/padding...
Author: duncanb7 replied at 2024-11-13 07:18:03
The sceond frame is Excel sheet save as .htm file. In the excel file, there is 3 sheets which is
also set by frame and frameset . Do you think that may make the issue.
also set by frame and frameset . Do you think that may make the issue.
<html xmlns:v="urn:schemas-microsoft-com:vml"xmlns:o="urn:schemas-microsoft-com:office:office"xmlns:x="urn:schemas-microsoft-com:office:excel"xmlns="http://www.w3.org/TR/REC-html40"><head><meta name="Excel Workbook Frameset"><meta http-equiv=Content-Type content="text/html; charset=big5"><meta name=ProgId content=Excel.Sheet><meta name=Generator content="Microsoft Excel 11"><link rel=File-List href="1000.files/filelist.xml"><link rel=Edit-Time-Data href="1000.files/editdata.mso"><link rel=OLE-Object-Data href="1000.files/oledata.mso"><!--[if gte mso 9]><xml> <o:DocumentProperties> <o:Author>kkw</o:Author> <o:LastAuthor>kkw</o:LastAuthor> <o:Created>2010-11-06T19:15:01Z</o:Created> <o:LastSaved>2010-11-12T18:45:49Z</o:LastSaved> <o:Version>11.9999</o:Version> </o:DocumentProperties> <o:OfficeDocumentSettings> <o:Colors> <o:Color> <o:Index>14</o:Index> <o:RGB>#DDDDDD</o:RGB> </o:Color> </o:Colors> </o:OfficeDocumentSettings></xml><![endif]--><![if !supportTabStrip]><link id="shLink" href="1000.files/sheet001.htm"><link id="shLink" href="1000.files/sheet002.htm"><link id="shLink"><script language="JavaScript"><!-- var c_lTabs=2; var c_rgszSh=new Array(c_lTabs); c_rgszSh[0] = "Daily13"; c_rgszSh[1] = "Intra13"; var c_rgszClr=new Array(8); c_rgszClr[0]="window"; c_rgszClr[1]="buttonface"; c_rgszClr[2]="windowframe"; c_rgszClr[3]="windowtext"; c_rgszClr[4]="threedlightshadow"; c_rgszClr[5]="threedhighlight"; c_rgszClr[6]="threeddarkshadow"; c_rgszClr[7]="threedshadow"; var g_iShCur; var g_rglTabX=new Array(c_lTabs);function fnGetIEVer(){ var ua=window.navigator.userAgent var msie=ua.indexOf("MSIE") if (msie>0 && window.navigator.platform=="Win32") return parseInt(ua.substring(msie+5,ua.indexOf(".", msie))); else return 0;}function fnBuildFrameset(){ var szHTML="<frameset rows="*,18" border=0 width=0 frameborder=no framespacing=0>"+ "<frame src=""+document.all.item("shLink")[0].href+"" name="frSheet" noresize >"+ "<frameset cols="54,*" border=0 width=0 frameborder=no framespacing=0>"+ "<frame src="" name="frScroll" marginwidth=0 marginheight=0 scrolling=no>"+ "<frame src="" name="frTabs" marginwidth=0 marginheight=0 scrolling=no>"+ "</frameset></frameset><plaintext>"; with (document) { open("text/html","replace"); write(szHTML); close(); } fnBuildTabStrip();}function fnBuildTabStrip(){ var szHTML= "<html><head><style>.clScroll {font:8pt Courier New;color:"+c_rgszClr[6]+";cursor:default;line-height:10pt;}"+ ".clScroll2 {font:10pt Arial;color:"+c_rgszClr[6]+";cursor:default;line-height:11pt;}</style></head>"+ "<body onclick="event.returnValue=false;" ondragstart="event.returnValue=false;" onselectstart="event.returnValue=false;" bgcolor="+c_rgszClr[4]+" topmargin=0 leftmargin=0><table cellpadding=0 cellspacing=0 width=100%>"+ "<tr><td colspan=6 height=1 bgcolor="+c_rgszClr[2]+"></td></tr>"+ "<tr><td style="font:1pt"> <td>"+ "<td valign=top id=tdScroll class="clScroll" onclick="parent.fnFastScrollTabs(0);" onmouseover="parent.fnMouseOverScroll(0);" onmouseout="parent.fnMouseOutScroll(0);"><a>«</a></td>"+ "<td valign=top id=tdScroll class="clScroll2" onclick="parent.fnScrollTabs(0);" ondblclick="parent.fnScrollTabs(0);" onmouseover="parent.fnMouseOverScroll(1);" onmouseout="parent.fnMouseOutScroll(1);"><a><</a></td>"+ "<td valign=top id=tdScroll class="clScroll2" onclick="parent.fnScrollTabs(1);" ondblclick="parent.fnScrollTabs(1);" onmouseover="parent.fnMouseOverScroll(2);" onmouseout="parent.fnMouseOutScroll(2);"><a>></a></td>"+ "<td valign=top id=tdScroll class="clScroll" onclick="parent.fnFastScrollTabs(1);" onmouseover="parent.fnMouseOverScroll(3);" onmouseout="parent.fnMouseOutScroll(3);"><a>»</a></td>"+ "<td style="font:1pt"> <td></tr></table></body></html>"; with (frames['frScroll'].document) { open("text/html","replace"); write(szHTML); close(); } szHTML = "<html><head>"+ "<style>A:link,A:visited,A:active {text-decoration:none;"+"color:"+c_rgszClr[3]+";}"+ ".clTab {cursor:hand;background:"+c_rgszClr[1]+";font:9pt ¿¿¿¿;padding-left:3px;padding-right:3px;text-align:center;}"+ ".clBorder {background:"+c_rgszClr[2]+";font:1pt;}"+ "</style></head><body onload="parent.fnInit();" onselectstart="event.returnValue=false;" ondragstart="event.returnValue=false;" bgcolor="+c_rgszClr[4]+ " topmargin=0 leftmargin=0><table id=tbTabs cellpadding=0 cellspacing=0>"; var iCellCount=(c_lTabs+1)*2; var i; for (i=0;i<iCellCount;i+=2) szHTML+="<col width=1><col>"; var iRow; for (iRow=0;iRow<6;iRow++) { szHTML+="<tr>"; if (iRow==5) szHTML+="<td colspan="+iCellCount+"></td>"; else { if (iRow==0) { for(i=0;i<iCellCount;i++) szHTML+="<td height=1 class="clBorder"></td>"; } else if (iRow==1) { for(i=0;i<c_lTabs;i++) { szHTML+="<td height=1 nowrap class="clBorder"> </td>"; szHTML+= "<td id=tdTab height=1 nowrap class="clTab" onmouseover="parent.fnMouseOverTab("+i+");" onmouseout="parent.fnMouseOutTab("+i+");">"+ "<a href=""+document.all.item("shLink")[i].href+"" target="frSheet" id=aTab> "+c_rgszSh[i]+" </a></td>"; } szHTML+="<td id=tdTab height=1 nowrap class="clBorder"><a id=aTab> </a></td><td width=100%></td>"; } else if (iRow==2) { for (i=0;i<c_lTabs;i++) szHTML+="<td height=1></td><td height=1 class="clBorder"></td>"; szHTML+="<td height=1></td><td height=1></td>"; } else if (iRow==3) { for (i=0;i<iCellCount;i++) szHTML+="<td height=1></td>"; } else if (iRow==4) { for (i=0;i<c_lTabs;i++) szHTML+="<td height=1 width=1></td><td height=1></td>"; szHTML+="<td height=1 width=1></td><td></td>"; } } szHTML+="</tr>"; } szHTML+="</table></body></html>"; with (frames['frTabs'].document) { open("text/html","replace"); charset=document.charset; write(szHTML); close(); }}function fnInit(){ g_rglTabX[0]=0; var i; for (i=1;i<=c_lTabs;i++) with (frames['frTabs'].document.all.tbTabs.rows[1].cells[fnTabToCol(i-1)]) g_rglTabX[i]=offsetLeft+offsetWidth-6;}function fnTabToCol(iTab){ return 2*iTab+1;}function fnNextTab(fDir){ var iNextTab=-1; var i; with (frames['frTabs'].document.body) { if (fDir==0) { if (scrollLeft>0) { for (i=0;i<c_lTabs&&g_rglTabX[i]<scrollLeft;i++); if (i<c_lTabs) iNextTab=i-1; } } else { if (g_rglTabX[c_lTabs]+6>offsetWidth+scrollLeft) { for (i=0;i<c_lTabs&&g_rglTabX[i]<=scrollLeft;i++); if (i<c_lTabs) iNextTab=i; } } } return iNextTab;}function fnScrollTabs(fDir){ var iNextTab=fnNextTab(fDir); if (iNextTab>=0) { frames['frTabs'].scroll(g_rglTabX[iNextTab],0); return true; } else return false;}function fnFastScrollTabs(fDir){ if (c_lTabs>16) frames['frTabs'].scroll(g_rglTabX[fDir?c_lTabs-1:0],0); else if (fnScrollTabs(fDir)>0) window.setTimeout("fnFastScrollTabs("+fDir+");",5);}function fnSetTabProps(iTab,fActive){ var iCol=fnTabToCol(iTab); var i; if (iTab>=0) { with (frames['frTabs'].document.all) { with (tbTabs) { for (i=0;i<=4;i++) { with (rows[i]) { if (i==0) cells[iCol].style.background=c_rgszClr[fActive?0:2]; else if (i>0 && i<4) { if (fActive) { cells[iCol-1].style.background=c_rgszClr[2]; cells[iCol].style.background=c_rgszClr[0]; cells[iCol+1].style.background=c_rgszClr[2]; } else { if (i==1) { cells[iCol-1].style.background=c_rgszClr[2]; cells[iCol].style.background=c_rgszClr[1]; cells[iCol+1].style.background=c_rgszClr[2]; } else { cells[iCol-1].style.background=c_rgszClr[4]; cells[iCol].style.background=c_rgszClr[(i==2)?2:4]; cells[iCol+1].style.background=c_rgszClr[4]; } } } else cells[iCol].style.background=c_rgszClr[fActive?2:4]; } } } with (aTab[iTab].style) { cursor=(fActive?"default":"hand"); color=c_rgszClr[3]; } } }}function fnMouseOverScroll(iCtl){ frames['frScroll'].document.all.tdScroll[iCtl].style.color=c_rgszClr[7];}function fnMouseOutScroll(iCtl){ frames['frScroll'].document.all.tdScroll[iCtl].style.color=c_rgszClr[6];}function fnMouseOverTab(iTab){ if (iTab!=g_iShCur) { var iCol=fnTabToCol(iTab); with (frames['frTabs'].document.all) { tdTab[iTab].style.background=c_rgszClr[5]; } }}function fnMouseOutTab(iTab){ if (iTab>=0) { var elFrom=frames['frTabs'].event.srcElement; var elTo=frames['frTabs'].event.toElement; if ((!elTo) || (elFrom.tagName==elTo.tagName) || (elTo.tagName=="A" && elTo.parentElement!=elFrom) || (elFrom.tagName=="A" && elFrom.parentElement!=elTo)) { if (iTab!=g_iShCur) { with (frames['frTabs'].document.all) { tdTab[iTab].style.background=c_rgszClr[1]; } } } }}function fnSetActiveSheet(iSh){ if (iSh!=g_iShCur) { fnSetTabProps(g_iShCur,false); fnSetTabProps(iSh,true); g_iShCur=iSh; }} window.g_iIEVer=fnGetIEVer(); if (window.g_iIEVer>=4) fnBuildFrameset();//--></script><![endif]><!--[if gte mso 9]><xml> <x:ExcelWorkbook> <x:ExcelWorksheets> <x:ExcelWorksheet> <x:Name>Daily13</x:Name> <x:WorksheetSource HRef="1000.files/sheet001.htm"/> </x:ExcelWorksheet> <x:ExcelWorksheet> <x:Name>Intra13</x:Name> <x:WorksheetSource HRef="1000.files/sheet002.htm"/> </x:ExcelWorksheet> </x:ExcelWorksheets> <x:Stylesheet HRef="1000.files/stylesheet.css"/> <x:WindowHeight>6225</x:WindowHeight> <x:WindowWidth>13995</x:WindowWidth> <x:WindowTopX>480</x:WindowTopX> <x:WindowTopY>120</x:WindowTopY> <x:ProtectStructure>False</x:ProtectStructure> <x:ProtectWindows>False</x:ProtectWindows> </x:ExcelWorkbook> <x:ExcelName> <x:Name>¿¿¿¿_1</x:Name> <x:SheetIndex>2</x:SheetIndex> <x:Formula>=Intra13!#REF!</x:Formula> </x:ExcelName> <x:ExcelName> <x:Name>¿¿¿¿_2</x:Name> <x:SheetIndex>2</x:SheetIndex> <x:Formula>=Intra13!#REF!</x:Formula> </x:ExcelName> <x:ExcelName> <x:Name>¿¿¿¿_3</x:Name> <x:SheetIndex>2</x:SheetIndex> <x:Formula>=Intra13!#REF!</x:Formula> </x:ExcelName></xml><![endif]--><!--[if gte mso 9]><xml> <o:shapedefaults v:ext="edit" spidmax="9218"/></xml><![endif]--></head><frameset rows="*,39" border=0 width=0 frameborder=no framespacing=0> <frame src="1000.files/sheet001.htm" name="frSheet"> <frame src="1000.files/tabstrip.htm" name="frTabs" marginwidth=0 marginheight=0> <noframes> <body> </body> </noframes></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: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:75:76:77:78:79:80:81:82:83:84:85:86:87:88:89:90:91:92:93:94:95:96:97:98:99:100:101:102:103:104:105:106:107:108:109:110:111:112:113:114:115:116:117:118:119:120:121:122:123:124:125:126:127:128:129:130:131:132:133:134:135:136:137:138:139:140:141:142:143:144:145:146:147:148:149:150:151:152:153:154:155:156:157:158:159:160:161:162:163:164:165:166:167:168:169:170:171:172:173:174:175:176:177:178:179:180:181:182:183:184:185:186:187:188:189:190:191:192:193:194:195:196:197:198:199:200:201:202:203:204:205:206:207:208:209:210:211:212:213:214:215:216:217:218:219:220:221:222:223:224:225:226:227:228:229:230:231:232:233:234:235:236:237:238:239:240:241:242:243:244:245:246:247:248:249:250:251:252:253:254:255:256:257:258:259:260:261:262:263:264:265:266:267:268:269:270:271:272:273:274:275:276:277:278:279:280:281:282:283:284:285:286:287:288:289:290:291:292:293:294:295:296:297:298:299:300:301:302:303:304:305:306:307:308:309:310:311:312:313:314:315:316:317:318:319:320:321:322:323:324:325:326:327:328:329:330:331:332:333:334:335:336:337:338:339:340:341:342:343:344:345:346:347:348:349:350:351:352:353:354:355:356:357:358:359:360:361:362:363:364:365:
Expert: elliottbrooks replied at 2024-11-13 06:12:44
That is odd - is it just a specific URL that causes this issue or any URL the frame loads?
Author: duncanb7 replied at 2024-11-13 05:51:29
Since the redirect URL is always changing, so I could not write every html with <style>margain:0px<style>
Author: duncanb7 replied at 2024-11-13 05:50:00
it is same as before for trying padding
If I go to the second frame's html and set style tag to merge body to frame that is no issue at all. So I don't
know why that is not working for parent.second
If I go to the second frame's html and set style tag to merge body to frame that is no issue at all. So I don't
know why that is not working for parent.second
Expert: elliottbrooks replied at 2024-11-13 05:10:51
Does changing the padding instead work?
parent.secondframename.document.location.href="http://www.yahoo.com";
parent.secondframename.document.body.style.paddingTop='0';
parent.secondframename.document.body.style.paddingLeft='0';
parent.secondframename.document.location.href="http://www.yahoo.com";
parent.secondframename.document.body.style.paddingTop='0';
parent.secondframename.document.body.style.paddingLeft='0';