Cross-platform SDK and HTML5 tools for mobile app development
X
 
5 posts / 0 new
Last post
horuko
horuko's picture
Offline
Joined: 6 Jul 2012
Posts:
error js validator at query mobile

Hello,

Every time I rebuild an hybrid app on mosync 3.1, I get a js validator error. This error only appears when I include jquery mobile lib in the project. The app works correctly, but this error always appear. The messagebox dont say big thing, only that there is a build error.

Anybody knows fix this?

thanks! :D

horuko
horuko's picture
Offline
Joined: 6 Jul 2012
Posts:
OK! Any fix? At recen mosync

OK!

Any fix?

At recen mosync updates, this error shows more details:

Errors occurred during the build.

Errors running builder 'JavaScript Validator' on project 'eLifeApp_0_2'.

org.eclipse.wst.jsdt.internal.compiler.lookup.MethodBinding cannot be cast to org.eclipse.wst.jsdt.internal.compiler.lookup.TypeBinding

 

 

ruudvdd
ruudvdd's picture
Offline
Joined: 18 Feb 2013
Posts:
Someone has an answer for

Someone has an answer for this? I'm having this problem too. I copied the header of the WebViewTwitter example literally in my project:

{syntaxhighlighter brush: xml;fontsize: 100; first-line: 1; }<meta name="viewport" content="width=devicewidth; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"/>

<title>Twitter Reader</title>

<link rel="stylesheet" href="jquery.mobile/jquery.mobile-1.2.0.min.css" />
<script src="jquery.mobile/jquery-1.8.2.min.js"></script>
<script src="jquery.mobile/jquery.mobile-1.2.0.min.js"></script>

<script src="js/wormhole.js"></script>{/syntaxhighlighter}

and copied all the jquery.mobile files exactly like in the example (/LocalFiles/jquery.mobile/*). The result is: syntax errors in both files (jquery.mobile/jquery-1.8.2.min.js and jquery.mobile/jquery.mobile-1.2.0.min.js) but no errors in the webviewtwitter example.

When including the not-minified version instead of the minified versions, all the syntax errors are gone, but after the compilation of my C/C++ code, it gives the same error huroku had:

{syntaxhighlighter brush: cpp;fontsize: 100; first-line: 1; }Errors occurred during the build.

Errors running builder 'JavaScript Validator' on project '<project name>'

11{/syntaxhighlighter}

I can run the program after this error, but this jquery code doesn't work:

{syntaxhighlighter brush: jscript;fontsize: 100; first-line: 1; }function initialize() {
$("#jq").click(function() { alert("jq"); });
$("#cpp").click(function() { alert("cpp"); });
}
document.addEventListener("deviceready", initialize, true);{/syntaxhighlighter}

and the body looks like this:

 

{syntaxhighlighter brush: xml;fontsize: 100; first-line: 1; }<body>
<div id="screen">
<input type="button" id="cpp" value="C++" style="height:100px; width:100px"/>
<input type="button" id="jq" value="JQuery" style="height:100px; width:100px"/>
</div>
</body>{/syntaxhighlighter}

 

When enabling javascript debugging, the program halts at line 4225 ...

{syntaxhighlighter brush: cpp;fontsize: 100; first-line: 1; }// Opera 10-11 does not throw on post-comma invalid pseudos
div.querySelectorAll("*,:x");{/syntaxhighlighter}

... without any breakpoint set by me. When I resume the run, the run halts at line 4242:

{syntaxhighlighter brush: jscript;fontsize: 100; first-line: 1; }// This should fail with an exception
// Gecko does not error, returns false instead
matches.call( div, "[s!='']:x" );{/syntaxhighlighter}

When I resume the run for a second time, the actual program starts, but the buttons don't work.

Both lines are in the same file: The uncompressed 1.9.1 build of jquery (not jquery mobile funny enough).

When I remove the contents of the jquery mobile file, no error message is displayed after a rebuild, but the buttons still don't work and the debugger still stops at those two specific lines.

I hope you got enough information. Else you can ask me for some more.

Thanks in advance

 EDIT:

I tried a little more and this code ...

{syntaxhighlighter brush: jscript;fontsize: 100; first-line: 1; }<html>
<head>
<meta name="viewport" content="width=320, user-scalable=no">
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>App</title>

<script type="text/javascript" charset="utf-8" src="js/wormhole.js"></script>
<script type="text/javascript" charset="utf-8" src="js/jquery-1.9.1.js"></script>
<script type="text/javascript" charset="utf-8" src="js/jquery.mobile-1.3.0-rc.1.min.js"></script>
<script type="text/javascript">

function initialize() {
$("#jq").click(function() {
alert("jq");
});
$("#cpp").click(function() {
alert("cpp"); }
);
}

document.addEventListener("deviceready", initialize, true);
</script>
</head>

<body>
<div data-role="page">
<input type="button" id="cpp" value="C++" style="height:100px; width:100px"/>
<input type="button" id="jq" value="JQuery" style="height:100px; width:100px"/>
</div>
</body>
</html>{/syntaxhighlighter}

... works (When I click the buttons, the app shows a toast saying the correct message), but the halts at the lines in the jquery file still occur at the beginning of the project + the error message after a rebuild still appears. If someone knows how to stop those two things, I'll be a happy camper :)

horuko
horuko's picture
Offline
Joined: 6 Jul 2012
Posts:
Hello! The error appears when

Hello!

The error appears when I put the jquery.mobile-*.*.*.js... when I removed it, The error disappear.: This is the error:

 

Errors occurred during the build.

Errors running builder 'JavaScript Validator' on project '<project name>'

11

...

I included jquery lib complete.

 

thanks.

Sam Pickard
rival's picture
Offline
Mobile Archmage
Joined: 19 Mar 2009
Posts:
Sorry, I've not seen that

Sorry, I've not seen that one.  Are you using the minified JQuery lib?  Have you packaged one, or are you getting it from CDN?

Login or register to post comments