javascript

jqGrid how to override the "view" m

I have a jqGrid where the "View" icon is enabled (view:true), so that a user picks a row in the grid, and then clicks the icon in the navbar to view the row. Thing is, what I really want to have happen is a redirect to a different URL, with the rowid included as a parameter in the URL (e.g. foo.htm?rowid=5) I went over the docs, and s...

How does stackoverflow implement the Title box so that it hides the text when you type?

On the "Ask Question" page, the text in the Title box says "What's your programming question? be specific.". When you click on it, the text remains, but when you type anything it goes away. How is this implemented? I'm looking through the script and failing to find the code that hides this overlay text. ...

How do I disable validation of Javascript in <script> tags in JSPs ...in Eclipse

I'm using JSTL to generate a JavaScript object in a bit of inline script in a JSP, like this: <script> var data = [ <c:forEach items="${MyData}" var="Datum" varStatus="status"> { foo: ${Datum.foo}, bar: '${Datum.bar}', }<c:if test="${not status.last}">,</c:if> </c:forEach> ...

How to call javascript from applet without use showDocument ?

Hi, I'm using getAppletContext().showDocument(new URL("javascript:" + command)); to call javascript from applet. But sometimes in firefox this doen't work, I don't know why. So, now I'm trying to use JSObject, using this: JSObject jsObject = new JSObject(); jsObject.eval(command); But I got this error: Exception in th...

using _gaq asynch in closures

When using var _gaq = _gaq || []; within a script tag what would be needed to support this in a closure to add analytics async requests. i.e. experiment = (function(){ var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-XXXXX-X']); _gaq.push(['_trackPageview']); var nobody_knows_this_var_...

Change name of a html class

Hi I use a website, which shows information i have no use for, so i tried to hide some of it with Stylish, an addon for Chrome to insert custom CSS. I will try to explain better. <div class="splitscreenleft"> <div id="toplevel" <div class="splitscreenleft"> <div id="coursesection" I want to hide one of those. Everything above split...

Looking for a JavaScript multi-level picklist DATE-PICKER widget.

I am looking for a sample of a date picker widget (for faster selection of Date Of Birth) that is in the form of a multi-level dropdown, like this: Field | | 1970 -----YearSelect 1971 1972 1973 ... | March ----------MonthSelect ...

How can I select a specific column in a row using jQuery and JavaScript?

I am very new to jQuery and JavaScript. I have a small question. Let's say i have a HTML table like the following <Table id="mytable"> <tr id="element"> <td>value</td> <td>text</td> </tr> </Table> In the above example i know the row id and i want to change the value of the second column of the row with that particular id. I need...

IE's document.selection.createRange doesn't include leading or trailing blank lines

I'm trying to extract the exact selection and cursor location from a textarea. As usual, what's easy in most browsers is not in IE. I'm using this: var sel=document.selection.createRange(); var temp=sel.duplicate(); temp.moveToElementText(textarea); temp.setEndPoint("EndToEnd", sel); selectionEnd = temp.text.length; selectionStart ...

How to select elements within a variable using jQuery?

Hey, I'm trying to make a simple image browser for TinyMCE which I am using in my CMS. As part of this I need to detect whether the user has selected an existing image, so I can display the "edit" form instead of the "choose an image form". var selected_html = ed.selection.getContent(); var $elem = $(selected_html); console.log($elem); ...

Firefox/XHTML: creating and appending nodes

I'm trying to replace a bunch of innerHTML references in code with DOM-compliant node stuff. <html> <body>hehe</body> <script type="text/javascript"> var myDiv = document.createElement('div'); myDiv.setAttribute('id', 'myDivID'); document.getElementsByTagName('body')[0].appendChild(myDiv); var tex...

Currying in YUI3 library

Does YUI3 library have currying functionality ? ...

jQTouch excute javascript code when going to next page

Hey, I have been working on an iPhone app that requires me to dynamically change the content. I have the following code: <div id="home"> <div class="toolbar"> <a class="blueButton" href="javascript: void(0);" onClick="$('#logout').show();">Logout</a> <h1>AllaccessMD</h1> </div> <h1>...

JavaScript undefined check

I often see JavaScript code where a function may take in an "options" object and use it like: var name = typeof options.name !== 'undefined' ? options.name : "Bob"; This seems like it would be equivalent to the following: var name = options.name || "Bob"; Now, I understand that in certain situations you may actually care that opti...

Does Netbeans support vs-doc syntax for providing Javascript intellisense?

I've been documenting my Javascript with v-doc comments, as this works really nicely with Visual Studio. I'm considering giving NetBeans a go, as it apparently has very nice intellisense/code completion. Will NetBeans support vs-doc comments? If not, then by what means does NetBeans provide intellisense for Javascript files? ...

Indent, pretty-print code including Django template tags, HTML, CSS, and JavaScript

In dealing with a bunch of crufty Django template files, I want to indent them. The files contain: HTML, the bulk of the file. Maybe a pre tag or two. JavaScript, inside script tags. CSS inside the style tags Django template directives inside {% ... %} pairs. Surely there is a tool to do this. Most of the tools do silly things whe...

how to declare variable in javascript

$("#btnsub").click(function () { var add = $("#txtname").val(); var obj; var geo = new google.maps.Geocoder; geo.geocode({ 'address': add }, function (results, status) { if (status == google.maps.GeocoderStatus.OK) { obj = results[0].geometry.location; obj = convert(obj); alert...

get an element's id

is there another way to get an element's ID? obj.getAttribute('id') ...

access iphone user settings from javascript

is there a way to access an app's iphone user default settings from javascript? ...

how to retrieve frame name

I find my self in a javascript function as a result of a onload clause in the body of a page. How do I determine the name of the frame I am in? I don't know the id. ...