Firefox history.pushState error - javascript

history.pushState(null, null, '?state=1');
When trying the above in firefox console, it returns the below error:
[19:15:18.029] history.pushState(null, null, '?state=1');
[19:15:18.032] [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMHistory.pushState]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: Web Console :: <TOP_LEVEL> :: line 1" data: no]
I am not sure why... Also, my webpage which uses History.js returns the same error too. Everything works fine in Chrome.
Firefox 12.0
Any help would be greatly appreciated...

Related

NS_Error_Failure on Javascript POST

I am having trouble with some javascript. The code snippet below creates a simple post request however it always throws an NS_Error_failure exception (details at the bottom of the page). Can anyone tell me whats wrong with this code?
window.onload = function () {
alert('0');
try {
var url = "Some URL";
var request = CreateHttpRequest();
if (request) {
alert('1');
request.open("POST", url, false);
request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
alert('2');
request.send('');
alert('3');
}
}
catch (err) {
alert(err);
}
}
[Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE)"
nsresult: "0x80004005 (NS_ERROR_FAILURE)"
location: "JS frame :: file:///C:/Users/Ben/Desktop/test.html :: <TOP_LEVEL> :: line 44" data: no]
I found the same problem and when I was sending all to an iframe, the problem solved when I add the "name" to the tag, maybe the target is not accesible by your script
<iframe id="iframe_execute" name="iframe_execute" frameborder="1" height="400" width="400"></iframe>
This error can be seen if there are,
URL not found
There is error in your server code or called URL.
There is not any visible problem in code you shared.
Please refer this link

elRTE error 0x80004005 in Firefox

Error: uncaught exception: [Exception...
"Component returned failure code: 0x80004005
(NS_ERROR_FAILURE) [nsIDOMNSHTMLDocument.execCommand]"
nsresult: "0x80004005
(NS_ERROR_FAILURE)"
location: "JS frame :: http://localhost/mypage/admin/elrte/js/elrte.min.js
:: <TOP_LEVEL> :: line 34" data: no]
Why am I getting this error in Firefox, with the elRTE plugin? I didn't try it in other version of Firefox. But in Firefox 5 I'm getting this error?
display:none in style parent div occurs this problem, I explain what I want to say in here,
http://elrte.org/redmine/boards/4/topics/3279

js method fails (throws exception?), which firebug does not report

The following js method does not return, yet firebug reports no exception:
function test_contains_doesNotBailWithoutException() {
$.contains(document.getElementById('navlinks', undefined));
// This line should be reached, or you should get an exception message in Firebug.
return true;
}
where navlinks is something that exists on the page, and $ is from jquery 1.5.1. The method exits (throws, I assume) while calling the contains method, in line 4639 of jquery1.5.1:
return !!(a.compareDocumentPosition(b) & 16);
where a is the navlinks div and b is undefined. Shouldn't firebug report an exception in the console?
To be sure, running the following in the firebug console yields neither an error message nor a return result:
return document.getElementById('navlinks').compareDocumentPosition(undefined);
EDIT: I'm using Firefox 4.0.1 and Firebug 1.7.1.
Yes, there should be an exception; I certainly get one with either the JavaScript version:
Error: uncaught exception: [Exception... "Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsIDOM3Node.compareDocumentPosition]" nsresult: "0x80070057 (NS_ERROR_ILLEGAL_VALUE)" location: "JS frame :: javascript:alert(document.body.compareDocumentPosition(undefined)) :: <TOP_LEVEL> :: line 1" data: no]
or the same thing from the jQuery version (which has a bracket in the wrong place in your example... not that it matters since the missing argument will naturally get filled in with undefined anyway):
Error: uncaught exception: [Exception... "Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsIDOM3Node.compareDocumentPosition]" nsresult: "0x80070057 (NS_ERROR_ILLEGAL_VALUE)" location: "JS frame :: http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js :: <TOP_LEVEL> :: line 16" data: no]

error in firefox with markitup

I get the following error when I use MarkItUp Editor,
uncaught exception: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMNSHTMLTextAreaElement.selectionStart]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /jquery.markitup.js :: get :: line 418" data: no]
the line is
caretPosition = textarea.selectionStart;
I searched the internet but found nothing that helps me. The problem is in firefox 3.6 and 4.1.

How does this create an error?

I have a jquery/ajax website at tarh33ls.com
For some reason, in firefox, i get the following error:
uncaught exception: [Exception...
"Component returned failure code:
0x80004005 (NS_ERROR_FAILURE)
[nsIDOMLocation.href]" nsresult:
"0x80004005 (NS_ERROR_FAILURE)"
location: "JS frame ::
http://tarh33ls.com/ :: ::
line 26" data: no]
Line 0
but line 26 is:
if (location.href.indexOf("#")==-1) {location.href="http://tarh33ls.com/#";}
How would that generate an error?
I'm not sure why the error happens, but it seems this fixes it:
Move the if (location.href.indexOf("#") == -1 code inside the $(document).ready block (at the top of it), like this:
$(document).ready(function() {
if (location.href.indexOf("#") == -1) {
location.href="http://tarh33ls.com/#";
}
$.ajaxSetup({
...etc

Categories