javascript

Score system based on time in Javascript

Hello everybody, I have used a jQuery script in order to have a countdown script on a php page that I am doing, but I would also like to have a score system in it based on the time the user takes to answer some questions. I am using some drag and drops and click in a certain link into an image map -which is the only correct link in the...

How do I write a mouse down event in JavaScript?

Hi, This is very basic I'm sure to JavaScript but I am having a hard time so any help would be appreciated. I want to call a function within a for loop using the mouseDown event occurring within an object's second child node. The part italicized is my attempt to do this. The swapFE function is still a work in progress by the way. And o...

live change handlers in jQuery 1.4.1 still don’t always work for select elements in IE

This question is related to my last one about jQuery 1.4. They supposedly fixed the bug causing the change handlers not to work in IE, but it is not fully fixed. I am trying to bind a live change handler to a select element. Most of the time, when I change it, the event handler fires. But if I tab to the element immediately after the pa...

Possible cases for Javascript error: "Expected identifier, string or number"

Some users are reporting occasional JS errors on my site. The error message says "Expected identifier, string or number" and the line number is 423725915, which is just an arbitrary number and changes for each report when this occurs. This mostly happens with IE7/ Mozilla 4.0 browsers. I scanned my code a bunch of times and ran jslint ...

Help with changing index in javascript/jquery

I have an javascript array, which looks like: var styles = new Array(); styles[0] = { ... Position: 0, ... }; styles[1] = { ... Position: 1, ... }; styles[2] = { ... Position: 2, ... }; ... styles[N] = { ... Position: N, ... }; I use this array to display a list, where each item is a div. The end result is this: <div id="container"> ...

Jquery postback, maintain same tab after postback

I'm using jquery tab and following js method, how and what can i modify it to maintain state of tab between postbacks? (This resets tabs to first tab after page_load) $(document).ready(function() { //When page loads... $(".tab_content").hide(); //Hide all content $("ul.tabs li:first").addClass("active").show(); ...

Is possible to make a <div> writable by user?

hi have to build a system that when a user write in a box a word that starts with # this is wrapped inside an html element. Inside input-text and textarea html don't work. I had thought with a div, is possible? ...

Create Google Earth zoom in

Is there any way to create a zoom in to a location like Google Earth for a site??? I think, I can do this with a slide show in Flash or jQuery, but I would like to know if there is a better alternative way! Thanks ...

Get the active index of the jquery accordion pane from asp.net on the server-side?

How can I get the active index of the jquery accordion pane when a button is clicked? What I want to do is when a button is clicked in pane 3 for example, I want to store that value and when the page is reloaded, I want pane 3 to remain open. I intially had this in my server side click and when I hard code a value in for paneIndex it w...

JsTestDriver easy appending of elements to the body via :DOC syntax?

I'm using js-test-driver to test my Javascript code on several browsers: TestCase("DropDownValueReplacerTestCase", { setUp:function() { console.log("BEGIN: setUp"); /*:DOC += <form id="bob"></form> */ console.log("END: setUp"); }, tearDown:function() { console.log("BEGIN: tearDown"); ...

Javascript/jQuery: does anybody already created a loading fixed div on top 100%:100% of the page with jquery?

Hi all, i used sometimes a 'loading' method with the javascript onload & onunloadbody events.(www.restaurantebarocortico.com) Now i'm learning jQuery, and i used the $(document).ready & $(window).unload to replace the old events, but the unload event isn't working correctly. Does anybody knows another method to call a function on unloa...

jQuery Validate Plugin: How can I add groups to a validator after its been initialized?

On our site we are using an embedded sign-up form from our ESP that uses the jQuery validate plugin. We are customizing the form a bit, adding a couple of custom fields (first name, last name) and we want them to be grouped so there is only one error message for both the fields. Since the form's validator has already been initialized I ...

javascript and combo boxes

I have a combo box in a Form View and onchange i want to access a javascript function just as i'd normally do any drop down list. However, it doesn't seem to be even getting to the function function Showused() { alert('eric'); } <telerik:RadComboBox ID="RadComboBoxProvided" onchange="javascript: Showused();" runat="server" Widt...

HTML 5 drag-drop into wysiwyg editor in Firefox

I have a wysiwyg editor using the HTML 5 drag-drop api to allow the user to place widgets within the page they are editing. When the OnDrop event fires, I prevent the default event, and insert some html within the editor that represents the widget they inserted. I use execCommand("inserthtml", false, html) for this in Firefox. This work...

JQuery: How do you change a graphic on a mouse hover event?

Using JQuery, how do I change a map icon whenever I mouse hover over a row in an HTML table/div? Here is an example: http://www.sfsunriseidx.com/homes/94131/?uuid=9ed7269b-5327-4c88-ba15-f700ed343d69&amp;source=REDIR Notice when you mouse hover over a home listing on the left, the corresponding map icon on the right changes. Question...

what is the jQuery / javascript context of a frame within an iframe?

Let me preface this with... I have referenced this question/answers and it seems to contain clues, but i'm still missing the whole picture http://stackoverflow.com/questions/539504/run-jquery-in-the-context-of-another-frame Essentially, the structure of the index page is this <html> <body> <div class="frames-wrap"> <iframe id=...

In Django, I know how to build a template. render_to_response('something.html'). But, how do I include a JSON object in there?

When the page loads, I have a JavaScript function that needs to analyze the JSON. But, this JSON must be present when I load "something.html" I know how to do this, but I don't know how to combine them together. return HttpResponse(thejson, mimetype="application/javascript") ...

detecting javascript disabled using prototype

Hi All, how can i detect whether javascript is disabled using prototype library. I dont want to <noscript> use tag but something that prototype offers. Thanks ...

Using IE conditional comments to include CSS or JavaScript files results in more http requests

A web designer has created pages for us with IE-specific comments. Consequently, certain stylesheets are only included if the user is using a specific version of IE: <!--[if lt IE 7]> <link type="text/css" rel="stylesheet" href="/styles/ie6-fixes.css" media="screen" /> <![endif]--> The same technique has been used for JavaScript file...

Javascript help

Somewhere in this javascript, it is telling my webpage to put a space in between each menu item. Here is the javascript: //** Chrome Drop Down Menu- Author: Dynamic Drive (http://www.dynamicdrive.com) //** Updated: July 14th 06' to v2.0 //1) Ability to "left", "center", or "right" align the menu items easily, just by modifying th...