clear what code is actually being run in the browser, never rely on looking
at your JSP source to understand it. That's what threw you off here. The
browser never sees your JSP source, only the HTML/JS/CSS/whatever files that
your JSP generates.
Do you have Fiddler? If not, go get it right now and get familiar with it:
It looks like you're using Windows 2000; Fiddler is supposed to run OK there
if you have the .NET Framework 2.0.
Fiddler's inspectors are great for examining all of the actual data
downloaded to your browser. You can of course use other tools such as the
Web Developer Toolbar and even a View Source for the .html file. But Fiddler
is terrific.
The main thing is that when you're debugging anything in the browser, you
have to forget about the JSP source and think only in terms of what the
browser actually receives.
-Mike
> From: kali
>
> this works in JSP:
>
> <% for (int i = 1; i < 5; i++) { %>
> $('#image<%=i%>').bind('mouseover',function(event) {
> $('#image<%=i%>').addClass('dim');
> });
> <% } %>
>
> but the same thing, in JavaScript, doesn't work:
>
> for (i = 1; i < 5; i++) {
> $('#thumb' + i).bind('mouseover',function(event) {
> $('#thumb' + i).addClass('dim');
> });
> }
No comments:
Post a Comment