Error with Jquery

Forums » Dev.Opera » Opera Dragonfly Discussions

You need to be logged in to post in the forums. If you do not have an account, please sign up first.

Go to last post

17. August 2012, 19:38:18

caiocgomes

Posts: 2

Error with Jquery

I am experiencing problems using Dragonfly since, so I trigger, starts to appear in Jquery error as reported below, this is happening to someone else?

Unhandled DOMException: SYNTAX_ERR


Thanks for the help

29. August 2012, 03:51:37

daidoji70

Posts: 2

Yeah I get the same error. Using jquery 1.8.0 minified or not, downloaded and from google's javascript library api. It appears to be coming from line 5095 of jquery 1.8.0 (development version). Any help with this issue would be grand.

try {
					matches.call( div, "[test!='']:sizzle" );  <---------- This line
					rbuggyMatches.push( Expr.match.PSEUDO );
				} catch ( e ) {}


About Opera
Version information
Version
12.01
Build
1532
Platform
Win32
System
Windows 7
XHTML+Voice
Plug-in not loaded
Browser identification

Opera/9.80 (Windows NT 6.1; U; en) Presto/2.10.289 Version/12.01

30. August 2012, 12:39:58

alwaysOpera

Posts: 638

this error is reported by chrome's developer tools too: it's not an issue between Opera javascript engine and jQuery framework.
By the way, there are two line of comment above the try/catch block here reported, that say "// This should fail with an exception // Gecko does not error, returns false instead", so only gecko-based browsers don't throw the exception
Ozone member - Operazone community

30. August 2012, 14:00:50

daidoji70

Posts: 2

Oh thanks. I didn't look too closely but its good to know why its happening.

Do you think this is an error I should report to the jQuery team or was this an intentional design feature that should be throwing the error (for some reason?). Basically, do you know why this is happening? I'm an amateur javascript developer and just like to understand more about why these things are happening. Was there a reason only gecko browsers shouldn't throw the exception or should I direct these questions to the jquery team?

30. August 2012, 18:29:11

alwaysOpera

Posts: 638

Originally posted by daidoji70:

Do you think this is an error I should report to the jQuery team or was this an intentional design feature that should be throwing the error (for some reason?).


I don't know... there is the ticket in the jQuery bug tracker (see http://bugs.jquery.com/ticket/12422), but it is closed.
Ozone member - Operazone community

3. October 2012, 06:06:20

fredvlad

Posts: 6

Using the current version of JQuery, in Windows Opera I am seeing no problems (so far, and I'm using a LOT of JQuery effects over HTML5).

Mac Opera, on the other hand, completely fails all JQuery (Opera 12.0). Totally. (http://jqueryui.com/themeroller/#themeGallery for example, comes up as unstyled content, all the JQuery functionality has Poofed. Poof!)

Methinks Opera, who is a big promoter of HTML5, has performed some political villainy here... truth?

BTW the version of JQuery used is 1.8.1. In Mac Opera even 1.7.2 is buggy. But only in Opera. What gives here?

3. October 2012, 10:16:25

lucienm

Posts: 2

I have the same problem, using jquery.min 1.5.2 with Opera 12.02 under linux.

If dragonfly is open, sometimes it reports an error on the only line of jquery.min.js Unhandled DOMException: SYNTAX_ERR.
I press Continue (F8), no problem.

4. October 2012, 16:00:25

fredvlad

Posts: 6

I've also attempted to write my site using regular Javascript, and Mac Opera 12.02 fails when calling DOM objects:

The below code fails on "document.querySelectorAll('div.operaBroken');", there is an "Uncaught Exception: TypeError cannot convert to Object" when defining a selected DOM object.

I've reinstalled Opera 12.02 from scratch. This being an unhandled exception, perhaps this is clearly a bug in browser JS handling?


<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8">
<title>Untitled Document</title>
<script type="text/javascript">
window.onload = docLoad();
var changeUp1 = document.querySelectorAll('div.operaBroken');
var changeUp2 = document.querySelectorAll('div.footergap');

function docLoad() {
if ((navigator.userAgent.indexOf("Opera") > -1) && (navigator.userAgent.indexOf("Mac") > -1)) {
changeUp1.style.display='block';
changeUp2.style.display='none';
}
}
</script>
</head>

<body>
<p class="operaBroken" style="display:none;"> broken!</p>
<p class="footergap" style="display:block">footergap</p>
</body>
</html>

5. October 2012, 12:43:14

Moderator

patrickhlauke

Posts: 29

Originally posted by fredvlad:


window.onload = docLoad();



this is wrong. you're not assigning the function to onload, what you're actually doing is immediately executing docLoad and passing the result to window.onload. i.e. you're executing the function before the document has finished loading, so it's not surprising your code throws.

try

window.onload = docLoad;

instead;

5. October 2012, 12:46:06

Moderator

patrickhlauke

Posts: 29

Originally posted by fredvlad:

Mac Opera, on the other hand, completely fails all JQuery (Opera 12.0). Totally. (http://jqueryui.com/themeroller/#themeGallery for example, comes up as unstyled content, all the JQuery functionality has Poofed. Poof!)



all works fine for me on Mac.

Originally posted by fredvlad:

Methinks Opera, who is a big promoter of HTML5, has performed some political villainy here... truth?



aeh...what?

5. October 2012, 12:57:03

Moderator

patrickhlauke

Posts: 29

as for the issue with jQuery throwing the DOMException, this is because of the "Show parse errors and break on exceptions" toggle being on in the Scripts panel in Opera Dragonfly by default. Even when the exception is wrapped in a try/catch, it nonetheless breaks. If you turn that toggle off, everything works fine. We're discussing changing/uncoupling those two settings in future revisions of Opera Dragonfly.

7. October 2012, 15:16:20

Mintsoft

Posts: 53

Originally posted by patrickhlauke:

If you turn that toggle off, everything works fine. We're discussing changing/uncoupling those two settings in future revisions of Opera Dragonfly.



It'd be great if you can do something to make Dragonfly work a bit nicer with jQuery, I was originally thinking some sort of optional "ignore exceptions when thrown by script X" list. I always end up just turning off break on exception if JQ is involved! sad
Presto/2.10.289 Opera 12.00 on Windows 7 Professional 64Bit

10. October 2012, 18:57:48

fredvlad

Posts: 6

Well, all righty then. Snarky comments regarding intentional failure of JQuery to get attention withdrawn. It probably was misunderstood anyway.

However, out of the box Opera 12.02 for Mac OS X 10.6.8 build 1578 does not display JQuery, still. Even after the Scripts "Show Parse Errors" is unchecked. http://jquerymobile.com/demos/1.2.0/docs/pages/loader.html or http://jqueryui.com/accordion/

Ugly, ugly. No styling whatsoever. Fails to provide functionality and styling.

And the reason for this is...? Does anyone else see this? Prove me wrong. Please.

BTW removing argument parens for docLoad was correct, my bad. Still, JQuery does not work. I must presume to turn away users with Mac on Opera when using JQuery.



11. October 2012, 21:46:28

Moderator

patrickhlauke

Posts: 29

Originally posted by fredvlad:

However, out of the box Opera 12.02 for Mac OS X 10.6.8 build 1578 does not display JQuery, still. Even after the Scripts "Show Parse Errors" is unchecked. http://jquerymobile.com/demos/1.2.0/docs/pages/loader.html or http://jqueryui.com/accordion/

Ugly, ugly. No styling whatsoever. Fails to provide functionality and styling.

And the reason for this is...? Does anyone else see this? Prove me wrong. Please.





Originally posted by fredvlad:

BTW removing argument parens for docLoad was correct, my bad. Still, JQuery does not work. I must presume to turn away users with Mac on Opera when using JQuery.



you must be doing something wrong somewhere along the line (your settings perhaps?), because it works...

11. October 2012, 21:51:20

Moderator

patrickhlauke

Posts: 29

Originally posted by patrickhlauke:

you must be doing something wrong somewhere along the line (your settings perhaps?), because it works...



for instance, you sure you haven't accidentally set the site preferences for jquery.com or similar to not have JS enabled?

12. October 2012, 23:45:07

fredvlad

Posts: 6

What does "out of the box" mean to you? Installing a fresh 12.02 and doing absolutely nothing with settings gives me the following:

http://desertbiz.biz/screenshot.jpg

This applies to ALL JQuery pages. Destroys the UI completely. Ain't my settings...

A,UCD puppies?
S, ICD puppies.
Well, MNO puppies...
Hmm, S, AR puppies! CMPN?

12. October 2012, 23:46:45

fredvlad

Posts: 6

AND...

I did a fresh reinstall, removing all prefs from my system.

Forums » Dev.Opera » Opera Dragonfly Discussions