javascript

error updating JScript IntelliSense warnings

How can this error be rectified? What's the cause of this error? Warning 1 Error updating JScript IntelliSense: Object doesn't support this property:@-- ...

how to read hidden div using jquery?

$('.slider').each(function(){ if($('li:last',this).width()+$('li:last',this).offset().left-$('li:first',this).offset().left < $('div',this).width()){ //doing something } }); I have multiple slides and only one is visible. here I'm trying to do some thing after reading each slides. Issue is that I'm not able to read slides if its hidde...

how to load an external css file if javascript is disabled.

how to load an external css file if javascript is disabled. Should work in IE 6 to 9, Firefox Google chrome, Safari I tried <noscript> And keeping <noscript> inside but it's not working in IE 7 ...

How to track change using Jquery if any field is being changed using javascript?

How to use Jquery if any field is being changed using javascript? I have hidden field whose value is being changed as per change of other field using javascript. Now I want jquery event function which can track this change of hidden field and do the needful. I tried with this : jQuery("#bannersize").change(function() but it didnt w...

How can I reproduce the "wait" functionality provided by JavaScript's confirm() function?

I'm trying to write a custom in-window confirm dialog (based on jQuery UI) that we can use to control all aspects of the window (button text, etc). What I'd really like is for the control to behave exactly the way that the built-in confirm() function behaves (call confirm(), script execution pauses until the user clicks ok or cancel, con...

large table with lots of events, is using event bubbling more effecient?

I have a large table/grid that has events on each row, table headers, etc. Instead of me generating events or binding events to each cell, would it be better to put a 'global' event and then I believe when clicked or mouseover events occur, it will bubble up to my 'global' event on the entire table and then I get filter the event caller...

Getting x and y position of mouse pointer relative to an element.

Hi can anyone help with this? When I move the mouse pointer of a element, I would like to retrieve the x and y positions relative to the <div> E.g - when I put the mouse pointer at the top left point of the div I would expect to get an X of 1 and a Y of 1. This needs to be compatible for Internet Explorer Thanks all for your time. ...

Encode email with PHP then decode with JS

I'm working on a website that has many business profiles with their contact information which also include email addresses. Obviously I don't want to output the plain email addresses in the source due to spam. Could do mrsmith[at]gmail.com or obfuscate with ASCII but these solutions aren't ideal, not 100% foolproof. The profiles do have...

Fire a click event in a parent window from a popup

Hi, I can successfully fire a click event in a button on a parent window from a popup in FF and Chrome... however nothing happens in IE. Any ideas? window.opener.document.getElementById(Client ID Of Button).click(); ...

Javascript truncate HTML text

Hello. Does JavaScript have a way of truncating HTML text without all the headaches of matching tags etc etc? Thank you. ...

Simple Javascript "undefined" question

I'm iterating over a bunch of child nodes and checking to see if they are actually visible on the page with this statement: if(child.offsetWidth == 0 || child.offsetHeight == 0 || child.style.visibility == 'hidden' || child.style.display == 'none'){ child is defined in the loop so that's not an issue. What is an issue is that ele...

json to java pojo with a map via GSON

My java pojo looks like this public class myPersonTO{ String name; String surname; Map<String, Double> categories; } I am using the gson library, however I an not sure what my json stringn, and the object it is created from should like; I am using json stringify, on a javascript object containing two strings and an array of obj...

TinyMCE pop up window resizing

I am using the TinyMCE editor, with the emotions plugin. Does anyone know how to resize the pop up window for the emotions plugin, as I have more emoticons that can fit in the window and the window has no scroll bar. I have tried editing the editor_plugin.js file but this didn't change anything. Any help appreciated. EDIT: My tinyMCE ...

changing selected text of dropdownlist in Gridview using javascript

I have a dropdownlist, and a Gridview where one of the columns is a dropdownlist. both dropdown lists use the same data source. When a value is selected in the dropdownlist (outside the gridview) I want to chaneg the selectedValue and selectText of every dropdownlist in my gridview. This is what I have tried: Dropdownlist: <asp:Drop...

jquery $.get help

Hello There, I am building a dynamic form in that the user can keep adding entries until they satisfied, to do this, I use this javascript, to pull in some html, $('#add_another').click(function(e){ $.get('/admin/add_grade_course', function(data) { $('#added_by_ajax').append(data); }); e.preventDefault(); }); The...

Timeout in a Couchapp list when using mustache

I have a simple list view in which I (try to) use mutache to render the output of a list containing 5 results. function(head, req) { var row, mustache = require("vendor/couchapp/lib/mustache.js"), template = "<li>{{project}} {{version}} {{description}}</li>"; while(row = getRow()) { send(mustache.to_html(template,...

Javascript: Enter does not work for submitting password

I can't get the following code working: when I press enter in the text-box, the function is not called. I can't see why though... <form> <p align="center"> <input type="password" class="password" name="text1" onkeypress="submitonenter(text1.value,"money","cash",event)" /><br> <input type="button" value="Enter" style="width: 100px" name=...

How to retrieve jQuery.mynamespace?

i have following code,i stored value in imgwidth variable var newImg = new Image(); newImg.src = document.getElementById('image').src; var height = newImg.height; var width = newImg.width; var width_img = width/3; jQuery.mynamespace = {imgwidth : width_img}; how can i retrieve imgwidth v...

Change Value Of A Field On Submit Using Javascript

I would like to add some JavaScript to do the following. I would have 3 fields like this. <input type="text" name="a" /> <input type="text" name="b" /> <input type="hidden" name="c" /> say if I entered 100 in the first field and 19 in the second field. it would divide 100 by 19 and round it up to no decimal places, and then replace ...

How/when is this anonymous function invoked?

Hi. I'm new to javascript and I am looking through some Raphael demo code. I'm confused by how this is working... if (R) { (function (dx, dy, R, value) { var color = "hsb(" + [(1 - R / max) * .5, 1, .75] + ")"; ... From what I can see this is declaring an anonymous function which takes 4 arguments. How is this function inv...