javascript

Disable Opera's autocomplete

Hello! Opera's autocomplete function draws a yellow border around text inputs where it saved data. Is there any way to disable it programmatically? Here's a picture to illustrate it: ...

Change HTML SELECT OPTIONs using a json object in FBJS

I have a html select input with a default set of options (it has an ID). I also have a json object that looks like var replacement_options = {'value 1':'display 1', 'value 2':'display 2' .... How would I replace the options in the select with the values and displays from the json object using Facebook JS? (FBJS) ...

Ordering of javascript execution (inline and external), IE vs. Firefox

I'm having some issues with the ordering of javascript execution in the following page: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; <html xmlns="http://www.w3.org/1999/xhtml" > <head> <script type="text/javascript"> var blah = 0; function scriptDo...

asp.net dropdownlist - C#.NET and javascript

I have a drop down and a div right next to it. The text contained inside the div should be updated based on value selected in the dropdown. I do NOT want to use AutoPostBack feature. ...

Remove all attributes

Is it possible to remove all attributes at once using jQuery? <img src="example.jpg" width="100" height="100"> to <img> I tried $('img').removeAttr('*'); with no luck. Anyone? ...

get thumbnail image swap to fade

hello everyone, I'm just getting to throwing myself into the javascript, jQuery pool and have found some possible alternative solutions but I wanted to see if there was a way I could acheive fadeIn/fadeOut with the existing javascript I am using. right now it is thumbnails that switch images in a main area onclick (actual site is onmo...

plot points for image map

I want to add automatic area highlighting to image maps on my webpage. I've found the mapper.js library to be very useful in achieving this, however creating the x,y plots around a regional map is very time consuming. Is there a quick way to create bounding co-ordinates of a irregular polygon such as can be found on regional maps? EDIT...

JQuery error property for error handler

Hello all, I'm just playing around for the first time with jQuery's ajax functionality. I wanted to add a function that could handle any errors. So, in one of my client javascript blocks, I added the following line: <script type="text/javascript"> .... $.ajax({ error: function () { alert('boo'); } }) .... </script> I expe...

Opera, custom context menu, picking up the right click

Hi, I want to implement a custom context menu on a site that I am working on. I have used document.oncontextmenu which works with all, except Opera, the main browsers that I am developing for. How would I the same result in Opera? I need to disable the default context menu and display mine. The first thing I would like to do is pick...

Calling $(document).ready(function() {...}); from another file

Hi all: As the title suggested, I'm trying to call the $(document).ready(function() {...}); from another file. The code snippet is as below: Source file: $(document).ready(function () { alert('document.ready function called!'); // a lot of code } And in the test file: TestFile.prototype.testDocumentReadyContents = function...

Specifying a single style sheet prblem.

In the case the html is opened in IE I want to use a different style sheet ONLY. However, it seems that it is pulling some elements properties from style.css as well. How can this be? Doesn't the [if gte IE 5] ensure only IEstyle.css is used? What is the best way to fix this? Thanks. <head> <title>!</title> <link rel="stylesheet"...

should I ALSO keep my data in a Javascript data structure? or just in the DOM?

Hi everyone, I am very new to Javascript and Jquery, so my apologies for this beginner's question. In a simple ajax web app, I am creating an HTML page which is mainly a big table. Each row in this table describes an event (party, show, etc). My page not only displays this information but is meant to let the user do a bunch of things w...

prototype in javascript

Javascript functions can also be declared prototype like <object name>.prototype.<variable name>=function(){ // // } How it is different than following declaration <object name>.<variable name>=function(){ // // } How prototype functions different than normal functions in javascript ? ...

Using jQuery to open all external links in a new window

New to jQuery here. I've found several web pages that come close to what I'm trying to do, but not quite. Actually, I think the following is supposed to actually work, but it's saying: [@href^="http://"] is not recognized (syntax error). Any help? $(document).ready(function() { $('a[@href^="http://"]').filter(function() { ...

Visual Studio 2008 schema validation for JavaScript

Hi there, I'm having a validation problem with JavaScript in Visual Studio 2008. By default, the validation schema is set to XHTML 1.0 Transitional for JavaScript files. This makes it difficult to format a lot of comments and code while I'm writing it (although it looks fine after all the semicolons are in place and such). I have a s...

javascript object gets overridden in IE

Geeks, I have the following codes: Snippet A: var x = (function(){ this.id="Dog"; return this; }()); var y = (function(){ this.id="Cat"; return this; }()); alert(x.id); //outputs Cat alert(y.id); //outputs Cat Snippet B: var x = (new function(){ this.id="Dog"; }); var y = (new function(){ this.id="Cat"; }); alert(x.id); //ouputs Do...

Easyslider 1.7 implementation issues

Hello everyone, I have been trying to implement the easyslider 1.7 plugin from cssglobe. Sorry could not post hyperlink because im a new user. I uploaded the test files within the download and everything worked fine as expected. I then started to implement on my test site. I included all files and added the slider id within my site und...

JS Include File From ASP.Net User Control

This maybe a very basic question but for the life of me I cannot figure it out. So I have a user control that gets loaded on a page. Well, in this user control, I'm wanting to include a js file for some functions that are only specific to that user control. Inside this js file let's say I have a function called 'MyFunction'. In the o...

Simple ajax not working, probably syntax error.

window.onload = function(){ testAjax(); } var testAjax = function(){ var request = window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest(); request.onreadystatechange = function(){ if (request.readyState == 4){ // Server is done try{ var p = document.getElementById['a']...

How to Set timer function

Hi I am doing online Exam Management, I have set a time duration for an exam to 5 min. When student attend this test, timer starts decreasing. I made this timer using javascript. What the problem is if the student refresh the page timer starts from first. How can I make the time to be static if page refreshed. ...