IEで JavaScript と VBScript -- 9つの HelloWorld

  Hello World (1)



JavaScript
  
<HTML>
<HEAD>
<META http-equiv="Content-type" content="text/html; charset=Shift_JIS">
</HEAD>
<BODY>

<SCRIPT language="JavaScript">

	document.write( "Hello World!!" );

</SCRIPT>

</BODY></HTML>

  

VBScript
  
<HTML>
<HEAD>
<META http-equiv="Content-type" content="text/html; charset=Shift_JIS">
</HEAD>
<BODY>

<SCRIPT language="VBScript">

	document.write( "Hello World!!" )
	Call document.write( "Hello World!!" )
	document.write "Hello World!!"

</SCRIPT>

</BODY></HTML>

  



  Hello World (2)



JavaScript
  
<HTML>
<HEAD>
<META http-equiv="Content-type" content="text/html; charset=Shift_JIS">
</HEAD>
<BODY>

<SCRIPT language="JavaScript">

	document.all.tags( "BODY" )(0).innerText = "Hello World!!";
	document.all.tags( "BODY" )[0].innerText += "Hello World!!";

	with( document.all.tags( "BODY" )[0] ) {
		innerText += "Hello World!!";
	}

</SCRIPT>

</BODY></HTML>

  

VBScript
  
<HTML>
<HEAD>
<META http-equiv="Content-type" content="text/html; charset=Shift_JIS">
</HEAD>
<BODY>

<SCRIPT language="VBScript">

	document.all.tags( "BODY" )(0).innerText = "Hello World!!"

	With document.all.tags( "BODY" )(0)
		.innerText = _
			.innerText & "Hello World!!"
	End With

</SCRIPT>

</BODY></HTML>

  



  Hello World (3)

JavaScript
  
<HTML>
<HEAD>
<META http-equiv="Content-type" content="text/html; charset=Shift_JIS">
</HEAD>
<BODY id=Main>

<SCRIPT language="JavaScript">

	document.all.item( "Main" ).innerText = "Hello World!!";
	document.all( "Main" ).innerText += "Hello World!!";

</SCRIPT>

</BODY></HTML>

  

VBScript
  
<HTML>
<HEAD>
<META http-equiv="Content-type" content="text/html; charset=Shift_JIS">
</HEAD>
<BODY id=Main>

<SCRIPT language="VBScript">

	document.all.item( "Main" ).innerText = "Hello World!!"
	document.all( "Main" ).innerText = _
		document.all( "Main" ).innerText & "Hello World!!"

</SCRIPT>

</BODY></HTML>

  



  Hello World (4)

JavaScript
  
<SCRIPT language="JavaScript">

function HelloWorld() {

	var HtmlString = document.all.item( "Main" ).innerHTML;

	HtmlString += "<br><br>Hello World!!";
	document.all.item( "Main" ).innerHTML = HtmlString;

}

</SCRIPT>
<HTML>
<HEAD>
<META http-equiv="Content-type" content="text/html; charset=Shift_JIS">
</HEAD>
<BODY id=Main>

</BODY></HTML>
<SCRIPT for=window event=onload language="JavaScript">

	HelloWorld();
	HelloWorld();

</SCRIPT>

  

VBScript
  
<SCRIPT language="VBScript">

Function HelloWorld()

	Dim HtmlString

	HtmlString = document.all.item( "Main" ).innerHTML
	HtmlString = HtmlString & "<br><br>Hello World!!"
	document.all.item( "Main" ).innerHTML = HtmlString

End Function

</SCRIPT>
<HTML>
<HEAD>
<META http-equiv="Content-type" content="text/html; charset=Shift_JIS">
</HEAD>
<BODY id=Main>

</BODY></HTML>
<SCRIPT for=window event=onload language="VBScript">

	HelloWorld
	HelloWorld()
	Call HelloWorld
	Call HelloWorld()

</SCRIPT>

  



  Hello World (5)

JavaScript
  
<SCRIPT language="JavaScript">

function HelloWorld() {

	alert( "Hello World!" );

}

</SCRIPT>
<HTML>
<HEAD>
<META http-equiv="Content-type" content="text/html; charset=Shift_JIS">
</HEAD>
<BODY id=Main>

</BODY></HTML>
<SCRIPT for=window event=onload language="JavaScript">

	HelloWorld();

</SCRIPT>

  

VBScript
  
<SCRIPT language="VBScript">

Function HelloWorld()

	alert( "Hello World!" )

End Function

</SCRIPT>
<HTML>
<HEAD>
<META http-equiv="Content-type" content="text/html; charset=Shift_JIS">
</HEAD>
<BODY id=Main>

</BODY></HTML>
<SCRIPT for=window event=onload language="VBScript">

	Call HelloWorld()

</SCRIPT>

  



  Hello World (6)

JavaScript
  
<SCRIPT language="JavaScript">

function HelloWorld() {

	// ダイアログ終了を待つ
	window.showModalDialog( "hw1_j.htm" );

	// ダイアログ終了を待たない
	window.showModelessDialog( "hw1_j.htm" );

}

</SCRIPT>
<HTML>
<HEAD>
<META http-equiv="Content-type" content="text/html; charset=Shift_JIS">
</HEAD>
<BODY id=Main>


</BODY></HTML>
<SCRIPT for=window event=onload language="JavaScript">

	HelloWorld();

</SCRIPT>

  

VBScript
  
<SCRIPT language="VBScript">

Function HelloWorld()

	' ダイアログ終了を待つ
	window.showModalDialog( "hw1_j.htm" )

	' ダイアログ終了を待たない
	window.showModelessDialog( "hw1_j.htm" )

End Function

</SCRIPT>
<HTML>
<HEAD>
<META http-equiv="Content-type" content="text/html; charset=Shift_JIS">
</HEAD>
<BODY id=Main>


</BODY></HTML>
<SCRIPT for=window event=onload language="VBScript">

	Call HelloWorld()

</SCRIPT>

  



  Hello World (7)

JavaScript
  
<SCRIPT language="JavaScript">

function HelloWorld() {

   var Handle;

   Handle = window.open(
      ""
      ,null
      ,"top=200,left=200,height=200,width=400,status=yes,toolbar=no,menubar=no,location=no"
   );

   Handle.document.write( "Hello World!!<br>" );
   Handle.window.focus();

}

</SCRIPT>
<HTML>
<HEAD>
<META http-equiv="Content-type" content="text/html; charset=Shift_JIS">
</HEAD>
<BODY id=Main>


</BODY></HTML>
<SCRIPT for=window event=onload language="JavaScript">

	HelloWorld();

</SCRIPT>

  

VBScript
  
<SCRIPT language="VBScript">

Function HelloWorld()

   Dim Handle

   Set Handle = window.open( _
      "" _
      ,null _
      ,"top=200,left=200,height=200,width=400,status=yes,toolbar=no,menubar=no,location=no" _
   )

   Handle.document.write( "Hello World!!<br>" )
   Handle.window.focus()

End Function

</SCRIPT>
<HTML>
<HEAD>
<META http-equiv="Content-type" content="text/html; charset=Shift_JIS">
</HEAD>
<BODY id=Main>


</BODY></HTML>
<SCRIPT for=window event=onload language="VBScript">

	Call HelloWorld()

</SCRIPT>

  



  Hello World (8)

JavaScript
  
<SCRIPT language="JavaScript">

function HelloWorld() {

	document.all.item( "MainFrame" ).style.display = "";
	document.frames( "MainFrame" ).document.write( "Hello World!!<br>" );

}

</SCRIPT>
<HTML>
<HEAD>
<META http-equiv="Content-type" content="text/html; charset=Shift_JIS">
</HEAD>
<BODY id=Main>
<IFRAME id=MainFrame width=200 height=200 style='display:none'></IFRAME>

</BODY></HTML>
<SCRIPT for=window event=onload language="JavaScript">

	HelloWorld();

</SCRIPT>

  

VBScript
  
<SCRIPT language="VBScript">

Function HelloWorld()

	document.all.item( "MainFrame" ).style.display = ""
	document.frames( "MainFrame" ).document.write( "Hello World!!<br>" )

End Function

</SCRIPT>
<HTML>
<HEAD>
<META http-equiv="Content-type" content="text/html; charset=Shift_JIS">
</HEAD>
<BODY id=Main>
<IFRAME id=MainFrame width=200 height=200 style='display:none'></IFRAME>


</BODY></HTML>
<SCRIPT for=window event=onload language="VBScript">

	Call HelloWorld()

</SCRIPT>

  



  Hello World (9)

JavaScript
  
<SCRIPT language="JavaScript">

function HelloWorld() {

	var RplString,WriteString;

	RplString = '<FRAMESET rows="100,*" name="MainFrame">';
	RplString += '<FRAME name="FrameHead">';
	RplString += '<FRAME name="FrameBody">';
	RplString += '</FRAMESET>'
	document.write( RplString )

	with( document.frames( "FrameHead" ).document ) {
	   write( "Hello World!!<br>" );
	   WriteString = "<INPUT type=button value=Next";
	   WriteString += " onClick='parent.FrameBody.document.write("Hello World!!")'>";
	   write( WriteString );
	}

}

</SCRIPT>
<HTML>
<HEAD>
<META http-equiv="Content-type" content="text/html; charset=Shift_JIS">
</HEAD>
<BODY id=Main>

</BODY></HTML>
<SCRIPT for=window event=onload language="JavaScript">

	HelloWorld();

</SCRIPT>

  

VBScript
  
<SCRIPT language="VBScript">

Function HelloWorld()

   Dim RplString,WriteString

   RplString = "<FRAMESET rows=""100,*"" name=""MainFrame"">"
   RplString = RplString & "<FRAME name=""FrameHead"">"
   RplString = RplString & "<FRAME name=""FrameBody"">"
   RplString = RplString & "</FRAMESET>"
   document.write( RplString )

   With document.frames( "FrameHead" ).document
      .write( "Hello World!!<br>" )
      WriteString = "<INPUT type=button value=Next"
      WriteString = WriteString & " onClick='parent.FrameBody.document.write("Hello World!!")'>"
      .write( WriteString )
   End With

End Function

</SCRIPT>
<HTML>
<HEAD>
<META http-equiv="Content-type" content="text/html; charset=Shift_JIS">
</HEAD>
<BODY id=Main>
<IFRAME id=MainFrame width=200 height=200 style='display:none'></IFRAME>


</BODY></HTML>
<SCRIPT for=window event=onload language="VBScript">

	Call HelloWorld()

</SCRIPT>

  










  infoboard   管理者用   
このエントリーをはてなブックマークに追加




SQLの窓  天気  IT用語辞典
Yahoo!ニュース  マルチ辞書
PHP マニュアル  Google URL短縮 


フリーフォントWEBサービス
SQLの窓WEBサービス

SQLの窓フリーソフト

素材

一般WEBツールリンク

SQLの窓

フリーソフト

JSライブラリ