javascript

javascript, css, z-index, div stacking.

I want to create a sort of light/thick box that only acts on a single DIV within a page. When mine fires off the first div(phantom_back) acts as I want it but the second, phantom_top sets its self after phantom_back regardless of its z-index and positioning. What am I doing wrong? Here is what I have so far: <html> <head> <script ...

Dead Center for JavaScript Output

Hi - I'm going to apologize in advance for how basic this question is, but this is my first time using javascript in html.. Basically, I have a javascript that produces a different bit of random text every time a user loads the page. I'd like to format that text in helvetica and then display it centered in the middle of the page. I'm...

How to determine if a keydown event occurs on a printable character?

We are trying to prevent users from typing beyond the maximum characters our DB allows for text area fields in our web app. Once they have reached the max length allowed in the text area we would still like to allow them to hit keys that are non-printing for example: Tab, backspace, ctrl+s, etc. I'm wondering if there is a simple way t...

Changing a function from iterative to recursive?

projectEuler3(600851475143); var projectEuler3 = function (composite) { var result = 2; while(composite > 1) { if (composite % result) { result++ } else { composite = composite / result; console.log(result); } } }; ...

Best practice - MOSS 07 and Javascript Files?

What are the suggested methods for using javascript files with MOSS 2007 ? in the 12 Hive somewhere or directly in the site's virtual directory in a scripts directory ? Or possibly as a embedded resource in a webpart ? ...

javascript or php - what is most efficient for updating?

I have several update methods in a javascript file, used for updating my ajax application, like so: function updateByPk(layer, pk) { url = "get_auction.php?cmd=GetAuctionData&pk="+pk+"&sid="+Math.random(); update(layer, url); } function updateByQuery(layer, query) { url = "get_records.php?cmd=GetRecordSet&query="+query+"&sid=...

deleting mysql records with ajax

I would like to know the best way to delete records from a live database and refresh the page instantly. At the moment I am using ajax, with the following javascript method: function deleterec(layer, pk) { url = "get_records.php?cmd=deleterec&pk="+pk+"&sid="+Math.random(); update('Layer2', url); } if cmd=deleterec on the php pag...

Pop-out music player from a frame

I am currently coding a website for a band and i have a music player located within a frame in the website. I would like to make the music player pop out from within the page when i click on a button. I was wondering if there was some sort of javascript/jquery code i can employ for this function. If not, what other work-around can i us...

Problem porting WordPress Editor to a non-WP application

I like the look and feel of the WordPress editor (version 2.7), and I would like to use it in another web application that is written in ASP.NET. I've used TinyMCE before, and I've even extended it in the past. However, I can't seem to get the Wordpress configuration to work! I've downloaded the entire WordPress package and taken the ...

Dojo - XHTML validation ?

Is it possible to make Dojo (javascript) widgets validate for XHTML? If so, how? Can it be something as simple as using CDATA? ...

How to handle an error that throws an alert box and make it show an AJAX error message instead?

I'm using Django and django-voting in an app I'm making. If a user who is not authenticated tries to vote, an alert box is displayed telling them they are not authenicated. How can I catch this error and make it into a more elegant AJAX display so I can show it right on the page when it happens? ...

Fill select dropdown based on selected item

I'm working on a rails app. I have a dropdown with countries. Selecting a country would fill the city dropdown with the cities in that country. I know how to do this server-side, but I'd like to do it client-side if possible. I've used the RJS helpers, but I've no experience with jQuery (not exactly even sure what it is) or the other...

Best way to preserve user-generated HTML across a post request?

I am building a site that is an interface used to create XML files that are read as input by a server side program. The website allows users to dynamically create blocks of HTML. Each block can be thought of as an object and contains several input fields. When the user submits the form, the data is turned into an XML file. What is th...

In Dojo or Javascript how do I make my event handler fire before other event handlers?

In the Dojo Javascript library, I understand how to use dojo.connect or dojo.publish to wire up my event handler to an event. That functionality works great. But I want to do one additional thing. I want my event handler to fire first, before any other already defined event handlers. I suppose this could be called "event handler inse...

A serious issue with jQuery and ActiveX security?

Has anyone not noticed that JQuery uses ActiveX controls? When a user has limited their activex security they will get script prompt popups and a yellow bar accross the top of their browser window. -This setting is by default on Windows Servers. -Internet Cafe's dont support Active X. -Company internal workstations dont support this. ...

jquery select image

I am looking to allow users to select a pre-uploaded image to a user generated web page. I have a list of the available images, so I could easily do this with a select control, however, I'd really like to allow the users to select from a pop up of thumbnails, rather than text, then have that populate a text form element with the resulti...

Identifying lastclick in javascript

Dear All, I need to get the Last Click arguments. My Javascript <a href="#" onclick="show(fid1,1);">Link1</a> <a href="#" onclick="show(fid2,2);">Link2</a> <a href="#" onclick="show(fid3,2);">Link3</a> Now I Need Another javascript Function that finds out the last click of show function's arguments. How to do it any idea? funct...

Ajax control toolkit Rating Control- Override RatingBehavior.js

Rating control in ajax control toolkit will not raise event if user clicks on current rating star becuase in behaviour js it has checking if (this._ratingValue != this._currentRating) , so i want to override this method without changing js and building tookit. How can i do it , can i extend rating control and overide RatingBehavior.js or...

Design order: Firefox, IE, or both?

When coding new javascript heavy websites, which order or web browser do you code for? I can see these possible orders, but I am not sure which I like best: Code for one first and get it working well, then start testing with other and fix errors as I go. This will allow for the most rapid development (with Firefox at least) but I've ...

How can I generate Dynamic Javascript?

I render a page using YUI. and depending on the user I need to change how it is rendered. This change is not something that can be parametrized, it is drastic and different for each user. Please tell me how can I generate Javascript dynamically? ...