IFRAME Syntax:
IFRAME tag -- indicates the HTML inline framework
- IFRAMETags appear in pairs.
<iframe>
Start,</iframe>
End
- Attribute
name
-- Defines the content page name, which is used for linking to the Framework page
src
-- Defines the content page url
- Frameborder -- defines the border of the content page. The value is (1 | 0) and the default value is 1.
1
-- Display a border between each page
0
-- Do Not Display borders
marginwidth
-- Defines the width of the upper and lower boundary displayed in the HTML file in the framework. The value is PX. The default value is determined by the browser.
marginheight
-- Defines the width of the Left and Right Border displayed in the HTML file in the framework. The value is PX. The default value is determined by the browser.
- Scrolling -- defines whether a scroll bar exists. The value is (
yes|no|auto
). The default value isauto
yes
-- Display the scroll bar
no
-- Do not display the scroll bar
auto
-- Display the scroll bar when necessary
align
-- Vertical or horizontal alignment
height
-- Framework height
width
-- Frame width
- URL: http://www.dreamdu.com/xhtml/tag_iframe/
Sample HTML code
- <IFRAMESrc = "http://www.dreamdu.com/xhtml/" width = "200" Height = "500"> </Iframe>
<iframe src="http://www.dreamdu.com/xhtml/" width="200" height="500"></iframe>
Main form: HTML code
- <HTML>
- <Head>
- <Title>CSI System</Title>
- </Head>
- <ScriptLanguage = "JavaScript">
- <! --
- Function F1 (STR ){
- Alert ("hello," + STR + ", I am the JavaScript method of CSI system! ");
- }
- //-->
- </SCRIPT>
- <Body>
- <IFRAMESrc = "cti.html" width = "250" Height = "200" scrolling = "no" frameborder = "1">
- </Iframe>
- <H1Id = "myh2">Hello, I'm CSI!</H1>
- </Body>
- </Html>
<HTML> Subform: HTML code
- <HTML>
- <Head>
- <Title>CTI system</Title>
- </Head>
- <ScriptLanguage = "JavaScript">
- <! --
- Function F2 (s ){
- Window. Parent. F1 (s );
- }
- //-->
- </SCRIPT>
- <Body>
- <FormMethod = post action = "">
- <InputType = "button" value = "Click me! "Onclick =" f2 ('cti ');">
- </Form>
- I am in CTI system!
- </Body>
- </Html>
<HTML> <HEAD> <TITLE> CTI System</TITLE> </HEAD><SCRIPT LANGUAGE="JavaScript"><!--function f2(s) {window.parent.f1(s);}//--></SCRIPT> <BODY> <FORM METHOD=POST ACTION=""><INPUT type="button" value="Click Me!" onclick="f2('CTI');"> </FORM> I am in CTI System! </BODY></HTML>
Effect:
Refer:
1. html <IFRAME> tag
2. A small IFRAME problem attracts great consideration
3. IFRAME
4. Javascript changes the IFRAME attribute (address, height, width)
5. Knowledge about js iframe operations
6. How to call the IFRAME parent window and Child Window
7. Access the User-Defined Functions in the parent window in the Child Window
8. DHTML Reference Manual: IFRAME element | IFRAME object
9. IFRAME usage and precautions
10. IFRAME syntax
11. Use IFRAME to embed and pre-load webpages
Reference page: http://www.cnblogs.com/waxdoll/articles/271018.html
5.2.6 Javascript
Extends Web pages use JavaScript to perform complex interactions between the user and the page. it is important to know how to execute JavaScript Functions from within Internet Explorer. the simplest method is to use navigate with the prefix javascript: Then the function name. however, this does not give us a return value, nor will it work correctly in all situations.
We shall start with a HTML page, which contains a JavaScript function to display some text. This will be saved as your cript.html
HTML code
- <HTML>
- <SpanId = "hiddentext" style = "display: none">This was displayed by JavaScript</Span>
- <ScriptLanguage = "JavaScript">
- Function jsfunction ()
- {
- Using plain Doc ument. All ["hiddentext"]. style. Display = "Block ";
- Return "OK ";
- }
- </SCRIPT>
- </Html>
We can then use the document. invokescript method to execute the Javascript thus:
C #2.0
C # code
- Private VoidBtnnavigate_click (ObjectSender, system. eventargs E)
- {
- Navigatetourlsync (@ "C:/javascript.html ");
- StringStrretval = "";
- Strretval = (String) Webbrowser. Document. invokescript ("jsfunction ");
- MessageBox. Show (strretval );
- }
private void btnNavigate_Click(object sender, System.EventArgs e){ NavigateToUrlSync(@"C:/javascript.html"); string strRetVal = ""; strRetVal = (string)WebBrowser.Document.InvokeScript("jsFunction"); MessageBox.Show(strRetVal);}
Http://www.javaeye.com/topic/265347