Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript_howto thread: Re: Free Javascript editor with "intillisence"


Message #1 by "Claudio Pallone" <pallone@l...> on Wed, 6 Nov 2002 17:07:39
Hi Sten,

Still no success -)

I followed your instructions but can not debug it. VSNET refuses to start 
debugging the code.

Please could try to run this code in VSNET and see if you can debug it? 
Please find below the Test.aspx page.

<%@ Page Language="vb" AutoEventWireup="false" Codebehind="test.aspx.vb" 
Inherits="Choices.test" debug="True"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
	<head>
		<title>test</title>
		<meta name="GENERATOR" content="Microsoft Visual 
Studio.NET 7.0">
		<meta name="CODE_LANGUAGE" content="Visual Basic 7.0">
		<meta name="vs_defaultClientScript" content="JavaScript">
		<meta name="vs_targetSchema" 
content="http://schemas.microsoft.com/intellisense/ie5">
		<script language="JScript">
		 window.onload = EnterHandler();

	function EnterHandler(oEvent)
	{
		//var oEvent = (navigator.appName == "Netscape")? 
oNSEvent : event;
		var oElm = (navigator.appName == "Netscape")? 
oEvent.target : event.srcElement;
		if(oEvent.keyCode == 13)
		{
			var intNewIndexFocus = parseInt(oElm.getAttribute
("indexNo"), 10) + 1;
			var arrInputFields = document.getElementById
("myform").getElementsByTagName("input");
			for(var i=0; i<arrInputFields.length; i++)
			{
				var oInput = arrInputFields[i];
				if(oInput.getAttribute("type") == "text" 
&& parseInt(oInput.getAttribute("indexNo"), 10) == intNewIndexFocus)
				{
					oInput.focus();
				}
			}
			(navigator.appName == "Netscape")? 
oEvent.preventDefault() : event.returnValue = false;
		}
	}
		</script>
	</head>
	<body MS_POSITIONING="GridLayout" onload="EnterHandler(event);">
		<form id="myform" name="myform" method="post" 
runat="server">
			<font size="2">SurName</font><br>
			<input name="surname" type="text" indexNo="1" 
onKeyDown="EnterHandler(event)" ID="Text1"><br>
			<font size="2">FirstName</font><br>
			<input name="firstname" type="text" indexNo="2" 
onKeyDown="EnterHandler(event)" ID="Text2"><br>
			<font size="2">FirstName</font><br>
			<input name="firstname" type="text" indexNo="3" 
onKeyDown="EnterHandler(event)" ID="Text3"><br>
			<font size="2">FirstName</font><br>
			<input name="firstname" type="text" indexNo="4" 
onKeyDown="EnterHandler(event)" ID="Text4"><br>
			<font size="2">FirstName</font><br>
			<input name="firstname" type="text" indexNo="5" 
onKeyDown="EnterHandler(event)" ID="Text5"><br>
		</form>
	</body>
</html>

Looking forwared to your reply

Cheers,

Claudio


> 
Hi,

Placing a breakpoint at a given point in your source file is the way to
go - but sometimes the breakpoint cannot be connected to an active
HTML/Javascript file.

Normally the procedure is this:
a) Open the source code in MS VS.Net
b) Open the source in a browser (MS IE 6.0 for instance)
c) in MS VS.Net place the breakpoint
d) Under "Debug" select "Processes" in which you can see a list
    of running tasks. It is importend that you find the browser window
    for THIS source (see point b) and then mark it, and click "attatch".
    This will link the source code in MS VS.Net to the running version
    of it...
e) Use the browser, and when the breakpoint is reached, the
     MS VS.Net will appear - showing a yellow highlighted line at your
     breakpoint. From here you can do the singlestep (and more!).
     As you probertly also know you can view local variables, add
    watches - for instance view the contents of "document.body" !!!
    And much much more!!! Very nice!!!

Should the question mark appear again, you have to try to
close the browser - open it again and then reattatch the source...

Sometimes you need to do this several times before it works!!
BUT it is worth all the effort!! :-)

Cheers,

Sten Hougaard
EDB Gruppen, Denmark
http://www.edbgruppen.dk



  Return to Index