PC Review


Reply
Thread Tools Rate Thread

Breakpoint in jscript not being hit

 
 
teddysnips@hotmail.com
Guest
Posts: n/a
 
      17th Mar 2008
In the past I've used the "debugger;" statement with great effect to
debug client-side JScipt.

Since I moved to Vista I've been having problems. The project is
VS2003 so I've got a dual-boot XP, which I'm currently running.
However, when I put the "debugger;" into my code, the breakpoint is
not at the "debugger;" statement but at the end of the previous form.
For example, it's not here:

// This is a form called SearchPeople.aspx
document.all.item("Form1").onsubmit=fubar;
function fubar() {
debugger; <-- NOT HERE
getE('cmdFilter').style.visibility = "hidden";
window.status = "Please wait...";
document.title = window.status;
document.all.item("Form1").style.cursor = "wait";
}

but here

//This is a form called logon.aspx
//-->
</script>
</body>
</HTML>
<-- this is where the yellow pipe shows up

If I press F8 to step into the next statement it goes into a
completely unrelated jscript function library. Note that the function
"fubar" is called on the form's "onsubmit", which is triggered by
pressing an Image button. If I keep stepping through the code it
eventually returns to the form, although the code in fubar is not run
(i.e. the control cmdFilter is not set to invisible as at line:

getE('cmdFilter').style.visibility = "hidden";

What really "bugs" me about this is that if I then REMOVE the line
"debugger;" and run the code, it STILL hits that breakpoint. If I
then run without debugging (CTRL + F5) then the form loads correctly
but when I press the Imagebutton to call the fubar function, I get a
"Just-In-Time Debugging" window informing me that "An exception
'Runtime error' has occurred in script" and inviting me to select a
debugger. If I select the currently running version of VS 2003,
though of course it's pointing at the wrong .aspx file and loads
logon.aspx as above.

Any thoughts, anyone? I've deleted all the .dll and .pdb files
several times.

Thanks

Edward
 
Reply With Quote
 
 
 
 
bruce barker
Guest
Posts: n/a
 
      17th Mar 2008
you probably have other javascript code throwing the error. i'd switch to
firefox/firebug which has better debugging, but you'd need to convert your
script to w3c standard (you will want to do this for ie 8.0 anyway or you
will have to run in non-standard mode)

-- bruce (sqlwork.com)


"(E-Mail Removed)" wrote:

> In the past I've used the "debugger;" statement with great effect to
> debug client-side JScipt.
>
> Since I moved to Vista I've been having problems. The project is
> VS2003 so I've got a dual-boot XP, which I'm currently running.
> However, when I put the "debugger;" into my code, the breakpoint is
> not at the "debugger;" statement but at the end of the previous form.
> For example, it's not here:
>
> // This is a form called SearchPeople.aspx
> document.all.item("Form1").onsubmit=fubar;
> function fubar() {
> debugger; <-- NOT HERE
> getE('cmdFilter').style.visibility = "hidden";
> window.status = "Please wait...";
> document.title = window.status;
> document.all.item("Form1").style.cursor = "wait";
> }
>
> but here
>
> //This is a form called logon.aspx
> //-->
> </script>
> </body>
> </HTML>
> <-- this is where the yellow pipe shows up
>
> If I press F8 to step into the next statement it goes into a
> completely unrelated jscript function library. Note that the function
> "fubar" is called on the form's "onsubmit", which is triggered by
> pressing an Image button. If I keep stepping through the code it
> eventually returns to the form, although the code in fubar is not run
> (i.e. the control cmdFilter is not set to invisible as at line:
>
> getE('cmdFilter').style.visibility = "hidden";
>
> What really "bugs" me about this is that if I then REMOVE the line
> "debugger;" and run the code, it STILL hits that breakpoint. If I
> then run without debugging (CTRL + F5) then the form loads correctly
> but when I press the Imagebutton to call the fubar function, I get a
> "Just-In-Time Debugging" window informing me that "An exception
> 'Runtime error' has occurred in script" and inviting me to select a
> debugger. If I select the currently running version of VS 2003,
> though of course it's pointing at the wrong .aspx file and loads
> logon.aspx as above.
>
> Any thoughts, anyone? I've deleted all the .dll and .pdb files
> several times.
>
> Thanks
>
> Edward
>

 
Reply With Quote
 
Will
Guest
Posts: n/a
 
      17th Mar 2008
On 17 Mar, 17:03, bruce barker <brucebar...@discussions.microsoft.com>
wrote:
> you probably have other javascript code throwing the error. i'd switch to
> firefox/firebug which has better debugging, but you'd need to convert your
> script to w3c standard (you will want to do this for ie 8.0 anyway or you
> will have to run in non-standard mode)
>
> -- bruce (sqlwork.com)


This won't work, I'm afraid - it's legacy code and there's no budget
for conversion such as you suggest. I just need to get debugging
working as it used to - any other ideas?

Thanks

Edward
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Breakpoint in jscript not being hit - answer but no solution teddysnips@hotmail.com Microsoft ASP .NET 5 19th Mar 2008 04:50 AM
Really weird - Code acting as though breakpoint set, no breakpoint BlueWolverine Microsoft Access VBA Modules 6 13th Mar 2008 04:20 PM
Problem with the breakpoint hitting(at runtime breakpoint was disa Ranjit Microsoft Dot NET Compact Framework 0 23rd Feb 2008 06:56 AM
Porting from JScript to JScript.Net - compiler error Jon Maz Microsoft ASP .NET 4 9th Sep 2004 11:24 AM
project stops at imaginary breakpoint, but no breakpoint exists Mark Microsoft ASP .NET 4 26th Apr 2004 05:23 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:11 PM.