JavaScript validation errors/warns I cannot solve [message #484272] |
Sat, 05 September 2009 08:27 |
Vlada Macek Messages: 2 Registered: September 2009 |
Junior Member |
|
|
Hi, I'm using the setup described below (was unable to add it as an attachment via the beta forums). Activated a JavaScript support for my PyDev project, because I have some JS code there, then added Firefox Browser Support Library.
But still I'm experiencing Problems I'm unable to solve while developing a special kiosk app for single browser. I'd be happy with merely masking these errors, but I couldn't find that options as I don't want to turn off entire error classes.
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 (looking for the <select> element):
var o = document.getElementById('id_publisher').options;
Thanks for any hints.
Eclipse IDE for C/C++ Developers 1.2.0.20090615-0818 epp.package.cpp
Eclipse Platform 3.5.0.I20090611-1540 org.eclipse.platform.ide
Eclipse Platform 3.5.0.v20090611a-9gEeG1HFtQcmRThO4O3aR_fqSMvJR2sJ org.eclipse.platform.feature.group
Eclipse Web Developer Tools 3.1.0.v200905242131-7R77FShEVw2xUGpF1LiNxdVAELXy org.eclipse.wst.web_ui.feature.feature.group
WST Common UI 3.1.0.v200903021835-7B5FREDhdMNPm7dkmBmpUJxRlMta org.eclipse.wst.common_ui.feature.feature.group
WST Common Core 3.1.0.v200903021835-7B77FXTF7RZHITIwQkLs_V org.eclipse.wst.common_core.feature.feature.group
WST Server UI 3.1.0.v200901260254-7B3DLAtJZNyxfIUbDVOO4256 org.eclipse.wst.server_ui.feature.feature.group
WST Server Core 3.1.0.v200901260254-30Et8s733L3E4H org.eclipse.wst.server_core.feature.feature.group
WST Server User Documentation 3.1.0.v200903071919-209L7w311A12343145 org.eclipse.wst.server_userdoc.feature.feature.group
WST Web Core 3.1.0.v200901280206-7H77FD4AT7oFldDfJV4g-6iAAR_z org.eclipse.wst.web_core.feature.feature.group
WST Web Services Core 3.1.0.v200905132336-7L7RFTUFGtGcn6glz-kxdBF462A org.eclipse.wst.ws_core.feature.feature.group
WSDL 1.5 Feature 1.5.3.v200903071919-2407w311917141519 org.eclipse.wst.ws_wsdl15.feature.feature.group
WST XML Core 3.1.0.v200901260254-7C7OFPeF7RZHIXHnTz0Jqc0 org.eclipse.wst.xml_core.feature.feature.group
WST Web Services UI 3.1.0.v200903020650-7I6FPlEtEnGxSBtv6tT6hoOXcS3b org.eclipse.wst.ws_ui.feature.feature.group
WST Web Services User Documentation 3.1.0.v200903071919-44FGz9oB55U5L8OAFEK org.eclipse.wst.ws_userdoc.feature.feature.group
WST Web User Documentation 3.1.0.v200903071919-31DF8s733J3E4D56BB org.eclipse.wst.web_userdoc.feature.feature.group
JavaScript Developer Tools 1.1.1.v200906091427-77-FGBCcNBC-BeMcEeOm org.eclipse.wst.jsdt.feature.feature.group
PyDev for Eclipse 1.5.0.1251989166 org.python.pydev.feature.feature.group
Web Page Editor (Optional) 2.2.0.v20090310-4339oB55W5K6F org.eclipse.jst.webpageeditor.feature.feature.group
[Updated on: Sat, 05 September 2009 08:32] Report message to a moderator
|
|
|
Re: JavaScript validation errors/warns I cannot solve [message #484693 is a reply to message #484272] |
Tue, 08 September 2009 18:32 |
|
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
_
Nitin Dahyabhai
Eclipse Web Tools Platform
|
|
|
|
Re: JavaScript validation errors/warns I cannot solve [message #485201 is a reply to message #484999] |
Thu, 10 September 2009 19:07 |
|
Vlada Macek wrote:
> Thanks for your answer.
>>> "style cannot be resolved or is not a field"
>>> "options cannot be resolved or is not a field"
>> 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.
>
> I suspected that. So I cannot cast the getElementById() result, mask the
> warnings, anything to wipe them out?
Unfortunately, no. It's a real bug/problem in that validator that
we're hoping to address in the next release.
--
---
Nitin Dahyabhai
Eclipse WTP Source Editing
IBM Rational
_
Nitin Dahyabhai
Eclipse Web Tools Platform
|
|
|
Powered by
FUDForum. Page generated in 0.03252 seconds