[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.webtools] Re: JavaScript validation errors/warns I cannot solve

Vlada Macek wrote:

I'm not very strong in JS so I'll appreciate a point to where the code is wrong.

"event cannot be resolved"
Line:
<body onmousedown="event.preventDefault()"> <!-- disables image dragging in Firefox -->


"style cannot be resolved or is not a field"
Line:
(<span style="color: blue; cursor: pointer;" onclick="var s=document.getElementById('debugQueryTable').style;s.display=s.display=='none'?'':'none';this.innerHTML=this.innerHTML=='Show'?'Hide':'Show'">Show</span>)



"options cannot be resolved or is not a field" Line: var o = document.getElementById('id_publisher').options;

The first error, about event being undefined, I'm not sure about. Where's that defined?


For the last two errors, Document#getElementById() isn't properly supported yet by the JavaScript validation inside of web pages. The returned "type" is supposed to vary based on which kind of element that ID was associated, but we won't have that HTML DOM integration until WTP 3.2 at the earliest.

--
---
Nitin Dahyabhai
Eclipse WTP Source Editing
IBM Rational