javascript

Binding an existing javascript function in JQuery

Using JQuery I want to bind an existing function to a button. I've been through the documentation and have found the bind method but the examples on the JQuery bind newly created functions where as I want to bind a function thats already hard coded, e.g: function fHardCodedFunction(){ //Do stuff } function fBindFunctionToElement(){ ...

Limit input box to 0-100

I have an input box that takes values from 0-100. I want to prevent users from writing anything larger or smaller. I've been using the jquery keyfilter plugin to limit the input of a field: http://code.google.com/p/jquery-keyfilter/ This plugin can limit the input to numerals, but not within a range. How do I prevent users from enterin...

Show/hide a div with jquery multiple times

I am wanting to use jquery to do a show/hide of a DIV from a text link. What makes it a little different from the examples I have found of this site so far is I need a generic way of doing it multiple times on 1 page and also able to use it sitewide on anypage. It would be really nice if I can put the JS in seperate file that is in...

AJAX document.getElementById().innerHTML problem with IE?

Before someone said that I did not read I may say that I read almost everything linked with my question. But I couldn't find my answer. So, I have a simple AJAX script that loads my external file inside predefined div. This is the code of those script: function loadTwitter() { var xmlHttp; try { // Firefox, Opera 8.0+,...

Height 100% on SPAN with multiple column

I have the code below with 3 columns. I want to have the border of each column and each column also has its own color. I tried many previous examples of multiple column css problem and they don't work. For example, I don't want to use dirty trick of background image to render background color and border because the website allows changin...

What's the best way to reuse Javascript routines in VS2008?

Probably a dumb question, but is it still using "Include files"? ...

Activate URL anchor but don't scroll to it?

I have a page with two tabs that I want to be able to switch with Javascript, but also set the anchor (e.g. page.html#tab1) in the URL for bookmarking/linking. By default the tab contents are in two divs, one below the other, and the anchor tag will scroll to the correct one, with JS disabled. With JS enabled, CSS classes are applied t...

Subclassing from (extending) an HTML element?

I'd love it if I could make my own class that extended an HTML element class, e.g. HTMLDivElement or HTMLImageElement. Assuming the standard inheritance pattern: // class A: function ClassA(foo) { this.foo = foo; } ClassA.prototype.toString = function() { return "My foo is " + this.foo; }; // class B: function ClassB(foo, b...

How do you add scripts to custom buttons on rows in jqgrid?

I am trying to handle the click of custom button in a jqgrid. I have the buttons showing up, but when they are clicked, my function does not run. If I click a button outside the jqgrid, the script runs. Does jqgrid consume the button click? Not sure what I am missing or not understanding. Here is the grid. The reason I am not reloading t...

JQuery $.post on a submit event help

What I am trying to do is: When you click on a form submit button, the page doesn't reload, instead data from form is send to another page for processing and HTML output of that page replaces the form on current page. More specifically, I am trying to get the add comment form working without a need to reload the page (there is a video s...

Problem with Javascript onUnload method

Hi, I have a requirement that when the user clicks on [X] button of the browser, I should give them a message. I accomplished this task using the onUnload method of JavaScript. Now, if even I refresh the page, then also the same message appears! Why this is so and how to overcome? The code is here <!DOCTYPE HTML PUBLIC "-//W3C//DTD ...

Finding string-key in Javascript array

1) I have this Javascript array: lang=new Array(); lang["sq"]="Albanian"; lang["ar"]="Arabic"; lang["en"]="English"; lang["ro"]="Romanian"; lang["ru"]="Russian"; 2) In some other process, there is a returned value in a variable: result.detectedSourceLanguage = 'en'; 3) Now, i want to print the language full name by doing this: ale...

detact http objects loading time in javascript

hi i need to capture the loading time of each http object such as img src="" and script src="" if it is impossible to loop the http elements, i can build an array and than loop that i know that i can use firebug, but i need that inside js thanks ...

How can i call a javascript function to run when innerHtml changes with Ajax?

I am using Ajax to change the innerHtml of a div by using onclick on a link. I need to call a javascript function after the file is retrieved from the server and replaces the content of the div. How can i do this? <div id="thisDiv"> <a href="this.php" onclick="ajaxfunction('thisfile.php','thisDiv');return false;">link</a> ... </div> T...

As a designer who has become proficient in HTML and CSS, is it safe to start using jquery plugins instead of learning javascript? I'm not a programmer..

I have mastered for the most part taking my designs and coding them as read only web pages. I'm looking to go the next level. I have used some jquery plugin's and figured them out quite easily with a bit of trial and error. I have also started reading a book on Java script but it seems like nothing I'll ever really need as I don't pl...

create vertical menu like www.tokonita.com

Hi all,i'm wondering how to create vertical menu like www.tokonita.com Can someone point me how to do it?Thanks.. ...

stackOverflow UI design secrets !!??

I am sure all of you have observed the cohesive design of this site. My question is about some of the cool info-boxes...that appear on various events. Like when someone with lower reputation tries to down-vote OR the long box that appears just below the browser address bar when I have got response to one of my questions. These are basic...

Rounded corner box technique with images all around as borders

Does anyone know good example of using CSS to create rounded corner box where: All 4 corners and 4 sides are image. The sides have repeated img The width is constant while height is flexible Work all in FF 3.x, IE 7 or higher, Chrome Let me know. Thanks ...

About jquery append and automatic deleting

when you append by using an existing content, jquery will delete the orignal: $(new).append($('#ori')); then the orignal $('#ori') in the document will be deleted, is this by design? ...

Is there anyway to detect whether a specific Opensearch search engine has been added to the browser?

Hi all. I am currently working on an application that requires to check whether the Opensearch has been added. I've successfully done the code that adds the search engine of my application to the browser via Opensearch XML file. but I wish to detect whether the search engine is currently installed or not. ...