javascript

How can I prevent auto-parsed, AJAX-gained JSON to become a window variable?

I'm using JSON to communicate some data through AJAX from the backend to the frontend (Javascript, of course). The XMLHttpRequest is done by a Prototypejs-written AJAX-handler (I'm still in the process of migrating to jQuery, but the noConflict-mode allows me to run both simultaneously), after which PHP sends the X-Json header with some ...

News Bar with jQuery

Hi, I need to make a horizontal "breaking-news" style bar with jQuery. I pick new from the server (the easy part) and I need some way to make them continually scroll from left to right. Any jQuery plugin to help me? thanks ...

How to log exceptions in JavaScript

As a C# developer I'm used to the following style of exception handling: try { throw SomeException("hahahaha!"); } catch (Exception ex) { Log(ex.ToString()); } Output ------ SomeNamespace.SomeException: hahahaha! at ConsoleApplication1.Main() in ConsoleApplication1\Program.cs:line 27 Its really simple, and yet tells me e...

how to register user clicked on link ads

I want to register user clicked on ads and save users info to database without change ads operation. <div> <a>ads link</a> // without modify ads <a>ads link</a> <a>ads link</a> <a>ads link</a> </div> how to update user info to database before load link ads. Please help. ...

Dijit.form.FilteringSelect initial display value

Is it possible to show and initial text in in a dijit.form.FilteringSelect wich is not an value. For example the search box on http://docs.dojocampus.org displayes the value "search" when it is not being used. I have tried using select.attr( "displayedValue", "My initial text" ) but becuase it is not an actual value the box will be mark...

Splitting HTML into multiple columns with Javascript/jQuery

Note: This is an alternate planned approach to this question: http://stackoverflow.com/questions/1238138/multiple-column-articles-in-joomla I've got a client who wants a multi column layout, which should be generated automatically from a non-column HTML block. What is the feasibility of using JavaScript (and jQuery) to create a multi-...

What books to start on web programming for an experienced non-web programmer?

No surprise here, possible dupes: Good Books for Learning Web Programming Required Reading for a Soon to be Web Developer and there will be more. For a personal project, I'm starting to do some web programming using Django. I've programmed since I was very young on several languages, mostly Pascal/Delphi, C/C++, SQL Pyt...

PHP: Show yes/no confirmation dialog

My php page has a link to delete one mysql table data.i want it to be in such a way that when i click the 'delete' link a confirm box should appear and it shoul ask for "are you sure, you want to delete?" with two buttons 'yes' & 'no'.when i click yes ,i want to delete the mysql table's data,and when i click no,nothing should happen. ple...

Suspend Default Event in jQuery

I am trying to delay the default event or events in a jQuery script. The context is that I want to display a message to users when they perform certain actions (click primarily) for a few seconds before the default action fires. Pseudo-code: - User clicks link/button/element - User gets a popup message stating 'You are leaving site' - M...

Convert c# to clientside Javascript

**UPDATED** I have an Asp.Net page with a list of options accompanied by a checkbox in a ListView control. I have applied Paging using the paging control. However i want to maintain the status of the checkboxes across the various paged pages of the ListView. I have done this with the following code private List<int> IDs { g...

Dashcode newbie question: Change a button's label programmatically

Hi all! I'm new to Mac OS X Dashboard developement. Now, I have a button with id b_start. When that button is clicked, I want the label of the button to change to "Round". Now I have tried these, but none of them work: document.getElementById("b_start").label = "Round"; document.getElementById("b_start").text = "Round"; document.getEl...

javascript crossbrowser new Image()

What is wrong with this function? It works in Opera and Firefox, but doens't work on Safari under the Windows function getImage(url) { var image = document.createElement('img'); // new Image(1, 1); image.src = url; image.onload = function() {}; } when I try getImage('http://site.com/someservlet.gif') This image i...

md5 hash for password string in GWT/GWT-Ext?

Hi everyone, I am currently trying to modify an existing GWT-Ext application, that is using plain text passwords in its MySql database. My plan was to use md5 hashes, as the existing passwords can be easily altered with the MySql function and I was expecting to find an easy solution for the GWT-Ext side as well. But as I found out, jav...

jQuery profiling - measure complete onReady runtime

Hi, I'd like to measure how long it takes to run the whole $().ready() scope in each of page. For profiling specific functions I just set a new Date() variable at the beginning of the relevant part and then check how long it takes to get to the end of the relevant part. The problem with measuring the whole $().ready scope is that it ...

Calling other plugins within a jQuery plugin.

In order to clean up my code i want to use sub-plugins within my actual jQuery plugin, but actually there is nothing happening. thx in advance As an easy example, please take a look at the following code: (function($){ $.fn.funct = function() { // so far it seems to run the code... console.log('funct is running...'); ...

How can I estimate browser's Javascript capabilities?

I serve a web page which makes the client do quite a lot of Javascript work as soon as it hits. The amount of work is proportional to the amount of content, which varies a lot. In cases where there is a huge amount of content, the work can take so long that clients will issue their users with one of those "unresponsive script - do you ...

google analytics - multiple trackers on one page (cookie conflict)

I'm writing a web application that's supposed to be embedded in other people's websites (kind of a widget). I'm using Google Analytics to track all the people that visit all instances of my script on the embedding websites. The problem is that I don't know how to use it so that it doesn't interfere with those websites' own Google Analyti...

Has anyone used GWT and can say it really delivers what it promises?

I am a long time Java web developer and as most web developers I have used quite a lot of JavaScript. Even though I don't hate JavaScript as many other Java developers, I am still aware of its faults. GWT is a way to write javascript using java. Since I know both languages for a long time I am pretty skeptical about this claim. I mean,...

Find DOM element by ID when ID contains square brackets?

I have a DOM element with an ID similar to: something[500] which was built by my Ruby on Rails application. I need to be able to get this element via jQuery so that I can traverse my way up the DOM to delete the parent of it's parent, which has a variable ID that I don't have access to beforehand. Does anyone know how I could go abo...

How to strip all parameters and the domain name from a URL using javascript?

Given a series of URLs http://www.anydotcom.com/myfolder/some-url.html http://www.anydotcom.com/myfolder2/index.html# http://www.anydotcom.com/myfolder3/index.html?someParam=aValue http://www.anydotcom.com/foldername/index.html?someParam=anotherValue First, how could I strip anything off the end of the URL so that I end up with http://...