Tag: firefox

create attribute in js triggers an exception 'not a function'

I’m using js to change the contents of a div that contents inputs i want to use them with Ajax , I’ve used Firefox scratchpad to debug this function: function show(id){ var div = document.getElementById(‘com’); div.innerHTML = ”; var input1 = document.createElement(‘input’) .createAttribute(‘type’).setAttribute(‘type’, ‘hidden’) .createAttribute(‘value’).setAttribute(‘value’,id ) .setAttribute(‘name’,’id’ ); var input2 = document.createElement(‘input’) .createAttribute(‘type’).setAttribute(‘type’, ‘input’) .createAttribute(‘name’).setAttribute(‘name’, […]

Range object , get Selection parent node Chrome vs Firefox

I am trying to make a small text editor. When I select a text, I want to know if the selected text is alone in a span or a div, then I want to change the style of this element. Example : <span style=”font-size:12px”>Hola</span> If I select Hola I want to retrieve the parent node […]

innerText not working in Firefox

This question already has an answer here: 'innerText' works in IE, but not in Firefox 15 answers

Handle non-ASCII filenames in XHR uploading

I have pretty standard javascript/XHR drag-and-drop file upload code, and just came across an unfortunate real-world snag. I have a file on my (Win7) desktop called “TEST-é-TEST.txt”. In Chrome (30.0.1599.69), it arrives at the server with filename in UTF-8, which works out fine. In Firefox (24.0), the filename seems mangled when it arrives at the […]

Using a javascript constructor to re-initialize an existing object

I’m using this function to create a particle for my particle system: function particle() { this.speed = {x: -1.5+Math.random()*3, y: -12+Math.random()*12}; this.location = {x: 50, y: 150}; this.radius = 5+Math.random()*8; this.life = 4+Math.random()*8; this.remaining_life = this.life; this.r = 255; this.g = 140; this.b = 30; } and I’m using this function to update the particles […]

Firefox addon compatibilty with version 11

I made an addon for Firefox and it works with the latest version. My problem is that I want it to work with all versions of Firefox. How can I do this? Info: I used the Add-on SDK to make the extension. I use jQuery too in my extension, could it come form here?

Javascript Countdown shows NaN in IE and Firefox, works in Chrome

I’m working on a site for a client where he needs a countdown timer to count down to 10pm two days from each site update. (or however many days he wishes to enter) The countdown functions perfectly in Google Chrome but in Internet Explorer and Firefox it shows NaN NaN. I’ve read this means “not […]

Firefox position absolute in table-cell

Suprisingly enough it’s not IE which causes me trouble, but Firefox. Fiddle: http://jsfiddle.net/EwUnt/ Point of this table is to highlight row and column of the cell on which cursor is. The thing is every time im testing it under Firefox it highlights only row itself instead of both, column and row.(works well in IE, Chrome, […]

Equivalent of simple storage API for restartless firefox extension

Is there an equivalent to this API or a way to call it from a restartless extension? I need to store a few strings between browser sessions. I have found this but it seems too complicated for simple string storage. Does the SS API use the same thing behind the scene?

Firefox Bookmarklet: Exposing functions to the global namespace

I’m working on a moderately-complex Bookmarklet that works just fine in Chrome, but I can’t get it to work in Firefox. When I run my Bookmarklet in Firefox it redirects to a new page that only says true on it. I’ve narrowed the cause down to a very specific thing: Firefox doesn’t seem to like […]