Skip to content
Advertisement

Tag: javascript

Close/hide an element when clicking outside of it (but not inside)

I have a <div> that exists on a page and I need to make it so that when the user clicks outside of that element it will become hidden, but if the user clicks somewhere within the element, then it should stay. I tried using e.stopPropagation(); and e.preventDefault(); adding it to the click event of that certain DIV but that

Javascript selecbox.options to array?

From what I understand a option elements that popuate select elements in HTML are an array. So basically what i want to do is return an array string that is separated by commas. Tried to do selecbox.options.join(‘,’);, but got an error that its not supported; anyone have an idea why? Answer It is not an array. It is an HTMLCollection.

what encoding this is?

can anyone tell me what encoding is applied on the chinese character, so that chinese characters are converted into this code or text and stored in mysql database : original chinese characters which are displayed in web page : on the web page there is a header function is used to make standard chinese chars as follow: Thanks… Answer When

Maximum size of a element

I’m working with a canvas element with a height of 600 to 1000 pixels and a width of several tens or hundreds of thousands of pixels. However, after a certain number of pixels (obviously unknown), the canvas no longer display shapes I draw with JS. Does anyone know if there’s a limit? Tested both in Chrome 12 and Firefox 4.

Json file gives 403 error on server

I have a json file contianing data which I access through javascript. On my virtual MAMP server on mac It works, but on my online server when I load the HTML file I cant access the json file from javascript. I get 403 no permission for access error. Why? Answer If your production server is Linux based then please consider

Issue regarding live event

I was just reading http://api.jquery.com/event.stopPropagation/ Since the .live() method handles events once they have propagated to the top of the document, it is not possible to stop propagation of live events I was a bit confused with this statement, Can someone please explain me the same with some example? Answer Live method binds a handler to the document, and identifies

Advertisement