Skip to content

Tag: html

File API – Blob to JSON

I’m trying to do some experiment with HTML5, WebSocket and File API. I’m using the Tomcat7 WebSocket implementation. I’m able to send and received text messages from the servlet. What I want to do now is to send from the servlet to the client JSON objects, but I want to avoid text message in…

Using AppMobi and Events

I am new to the new AppMobi world, so can you please help me. I have created an image object and have drawn it to the stage. My problem is that I want to add an event to object. I have set the image using: And I have drawn it to stage: Now I want to add an event to

Three.js WebGL texture shows up black on plane

So basically, I have a scene in WebGL with 2 planes. One of them has a transparent texture on it and it shows up fine. The other is supposed to have a high res, non-transparent texture loaded up on it and it is used as a background. I can’t figure out why the background plane isn’t working, since …

Limit min/max integer on javascript variable

Im trying to make a talent calculator of sorts, clicking the ‘skill’ will decrease this variable and right-clicking will increase the variable. The problem i have is i want the variable to be limited from going over 50 or below 0. Now ive googled and searched here for variable limits and max integ…

Focus an enter key to a specific button

I am currently facing a problem. I need have a form to be fill by a user ie: So now I need the way to focus on the ‘Save’ button when a user has filled the last text box in a form, so that even when the user clicks on the ‘Enter’ button the save event get run. This usually

jQuery toggle function disorts text

I have some functions to toggle 2 parts of an HTML if I click the ‘rejt’ button. Normally it looks like this: But after using the button to toggle it back again, it gets disorted like this: Please help me fix this. Code sample: Answer First of all, what’s with the font and id tags? Not sure …

Making line numbers uncopyable

I’m working on adding line number support to Rainbow, a syntax highlighter, but I can’t figure out how to make the line numbers uncopyable. Disabling selection via user-select: none; makes an element unhighlightable, but you can still copy its text by highlighting around it and then copying, which…