My forum (based on phpbb3) has a Javascript error that I'd like to resolve. In FF and IE the following error occurs:
Error: SXBB[id].resize is not a function
Source File: http://digital-diy.com/forum/classes/scripts/select_expand_bbcodes.js
Line: 197
The mod that uses this script is called "Syntax Highlighter 1.0.15". The developer is not sure why the error occurs, hopefully someone at stackoverflow can lend a hand?
Track down the SXBB object or array and view the id variable.
Make sure that property (what id refers to) is set on that object (SXBB).
My guess is it isn't, and it's undefined, and undefined has no resize() method.
Related
Lately we have been getting a lot of javascript errors "can't redefine non-configurable property "userAgent"".
We don't attempt to redefine userAgent in our code. We barely even reference userAgent. The only places would be in code like the following:
var browser_msie = (navigator.userAgent.match(/msie/i) || navigator.userAgent.match(/trident/i)) ? true : false;
I am wondering if this error is rather coming from some bad browser behavior. It only started showing up recently.
Last evening we got over 20,000 of such error messages, and all from the same member of our service.
EDIT
The error information is as follows:
Error Message:
Message: TypeError: can't redefine non-configurable property "userAgent"
URL: https://www.rephunter.net/member-home.php
Line:1
Column:130
Stack:#https://www.rephunter.net/member-home.php:1:130
Error Traceback:
#0 Called backtrace in file /var/www/rephunter/www/webroot/include/error-handler-inc.php as line #68
#1 Called error_handler in file as line #
#2 Called trigger_error in file /var/www/rephunter/www/webroot/ajax/javascript-error.php as line #14
Unfortunately this offers no help, as line 1 of the page is just <!DOCTYPE html>. I don't see how to get to that part of the code. Of course if that were possible it might be easy to see the cause of the issue.
I recall in the past the Dev Tools might have given a "spiders view" of the page, but now I only see the DOM on the Elements tab, and Sources. Both of these are formatted and their is no way to see what "line 1 char 130" means.
I am trying to translate this js code into ruby code
document.ontouchstart ? 'touchstart' : 'click';
I am using opal-browser to get browser functionality. My current attempt is this:
touch = Browser::Event::Touch.new
puts touch.start?
However this returns the error:
Uncaught TypeError: Cannot read property 'type' of undefined
When I checked the error trace the error seems to be coming from a missing name property in the Touch class.
Hoping Opal community can help me out here
If you want to check if touch is supported you need to call Event::Touch.supported?.
For the error, it's happening because .new expects the event object as parameter, if you want to create a new event object you need to call .construct.
In retrospect it would have probably been better to have .construct be .new, and .new be .wrap or something on that line.
today I had a strange problem in my serverside javascript.
I have a scriptLibrary in which I have some error-handling (try {...} catch(e) {...})
But somethings wrong with the variable "e". On the command e.printStacktrace() (which works useally) I got an exception: Error calling method 'printStackTrace()' on an object of type 'Error [JavaScript Object]'
I have another library, in which I pass the exception to a Java Class which creates a log document in my database, using it thows another exception which says that the variable "e" is not a thowable Exception. Checking that with a print(typeof e) return only "object".
Shouldn't that be a kind of exception on which I can use the standard methods? Do you have any idea what could cause that?
Thanks in advance.
Matthias
The error is not a Java Exception, this is why there is no stack information and no printStackTrace() method available.
Your code throws a Javascript error object. Try e.getMessage() or just a print(e) to get the reason for the failing of your code.
So I am getting the following error in firebug regarding jQuery UI. It would be as simple if it was a matter of a process-of-elimination on the JS on the page, but there is allot of JS as well as some on the page and some on the site.master.
ERROR
(this.uiDialogTitlebarCloseText = c("<span/>"))
.addClass("ui-icon ui-icon-closethick").text(m.closeText).appendTo
is not a function
Is there a way in Firebug to see what javascript is the initial caller?
Well your problem is likely that m.closeText is null. If you pass a null argument to text() it will actually return the text of the element, and not set the text to null.
I'm not sure about how to debug it though.
EDIT: The error is thrown because if text(null) returns a string, than you'll be saying string.appentTo rather than $().appendTo.
We are using HTML Unit v2.6 with Web-Harvest and extended its functionality to create a new element
<web session="sess1" browser="firefox2">
<web-getpage url="https://www.linkedin.com/secure/login"/>
<web-setinput name="uname">username</web-setinput>
<web-setinput name="pwd">password</web-setinput>
<web-clickinput name="login"/>
</web>
When we run this we get an exception while the element loads the URL specified. The details are as below:
Caused by: net.sourceforge.htmlunit.corejs.javascript.EcmaError: TypeError: Cannot find function hasOwnProperty in object net.sourceforge.htmlunit.corejs.javascript.EcmaError: ReferenceError: "Sizzle" is not defined.
at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3651)
at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3629)
at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.typeError(ScriptRuntime.java:3657)
at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.typeError2(ScriptRuntime.java:3676)
at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.notFunctionError(ScriptRuntime.java:3740)
at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.getPropFunctionAndThisHelper(ScriptRuntime.java:2249)
at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.getPropFunctionAndThis(ScriptRuntime.java:2216)
at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpretLoop(Interpreter.java:1501)
at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpret(Interpreter.java:845)
at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.call(InterpretedFunction.java:164)
at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.doTopCall(ContextFactory.java:427)
at com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory.doTopCall(HtmlUnitContextFactory.java:263)
at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3058)
at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.exec(InterpretedFunction.java:175)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$5.doRun(JavaScriptEngine.java:415)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:520)
... 42 more
As it appears that 'Sizzle' (present in YUI3) is causing this. We then checked the same in Firefox and IE but neither of the browsers showed any error of 'Sizzle' not being defined.
Also we tried to use latest snapshot of htmlunit, but had same issue.
Is this a limitation(bug) of HTML Unit JavaScript engine?
OR
Is there anyway to configure HTML Unit to handle this exception?
If anyone has already had such an issue, please do let us know.
Any help is very much appreciated.
Thanks in advance !
Sizzle is jQuery's selector engine. It is not included in YUI 3.