Skip to content
Advertisement

Tag: javascript

How to do JSLint in Vim

I spend my days in vim, currently writing a lot of JavaScript. I’ve been trying to find a way to integrate JSLint or something similar into vim to improve my coding. Has anyone managed to do something like this? I tried this: Javascript Syntax Checking From Vim, unfortunately the output is very crude. Answer You can follow the intructions from

Print only?

How do I print the indicated div (without manually disabling all other content on the page)? I want to avoid a new preview dialog, so creating a new window with this content is not useful. The page contains a couple of tables, one of them contains the div I want to print – the table is styled with visual styles

Creating a textarea with auto-resize

There was another thread about this, which I’ve tried. But there is one problem: the textarea doesn’t shrink if you delete the content. I can’t find any way to shrink it to the correct size – the clientHeight value comes back as the full size of the textarea, not its contents. The code from that page is below: Answer This

Where should I put tags in HTML markup?

When embedding JavaScript in an HTML document, where is the proper place to put the <script> tags and included JavaScript? I seem to recall that you are not supposed to place these in the <head> section, but placing at the beginning of the <body> section is bad, too, since the JavaScript will have to be parsed before the page is

RegEx for Javascript to allow only alphanumeric

I need to find a reg ex that only allows alphanumeric. So far, everyone I try only works if the string is alphanumeric, meaning contains both a letter and a number. I just want one what would allow either and not require both. Answer Update (supporting universal characters) if you need to this regexp supports universal character you can find

Advertisement