javascript

JavaScript: Get Argument Value and NAME of Passed Variable

What I want to do is get the NAME of a variable passed to a function and the VALUE of that variable and only have to pass in one variable to the function. So: var x = "anything"; function showName() { } showName(x); or showName("x"); Which will return: "x = anything". Right now, I have to do: showName("x", x); in order to ge...

Jquery cycling through multiple images and showing 3 at a time

Hi folks! Can you please point me to a jquery plugin, or a snippet I can use to make this? Here's the question: Say I have 12 images and I want to show 3 at a time and cycle through the 12 in this fashion: (img1-img2-img3) then (img2-img3-img4) then (img3-img4-img5)... See what I mean? In fact, I want a kind of marquee for images. ...

How can you swap an input text field to a password area on focus in JQuery?

I would like to display "password" as text in the password area, and when focused the box should become empty and allow normal password (starred out) input from the user. Currently I use the following method. Initially I display a text field showing password, when focused it is removed and replaced with a password field. Here is the jQu...

Remove Refresh Help Jquery

I am trying to get the div recentactivity to only refresh when Remove is clicked < a href='#' onclick=\"javascript:remove_wall('$id')\">Remove but when every i click on the link it keeps trying to refresh. when the mouse go's over the tr a link comes up saying remove here is the code for that. $(function() { $("tr").hover(function() ...

Is checking mousemove a good way to determine whether or not to download assets?

So I've got a web app that is for all intents and purposes a photo viewer. When a thumbnail is clicked, the app requests the image asset, injects it into the DOM as an IMG tag and disposes the other (MooTools Asset.image, inject and dispose). If they click on an image that has already been loaded I just inject it again since dis...

Javascript packing problem

I have a minified/packed javascript file which is causing problems. The issue is that the non-packed input file has some missing semicolons somewhere which aren't a problem when there's line breaks, but when the file is packed, the line breaks are removed and that causes a parser error. For example: //input var x = function() { doSo...

Adding a custom style to content editor

I have the standard content editor that uses an iFrame as the text area and then onchange of dropdowns it performs: idContent.document.execCommand(cmd,"",opt); where "idContent" is the iFrame. One of the dropdowns is supposed to be style but it performs a "formatBlock" command. I have a custom style sheet. Is there a way for me to p...

Force link to mp3 file to download/save-as

I have links to mp3 files on my website (normal <a href="file.mp3"> tags). But for many users who have QuickTime installed, it will open the mp3 files rather than "save" them when you click on the links. Can you force the browser to save the link rather than using the browser preference? I can use JavaScript or C# .NET but I'm looking...

Why is my onbeforeunload handler causing an "Unspecified error" error?

I am using the following JavaScript function within IE6: window.onbeforeunload = function() { if (itemChanged) { return 'You have made changes to data on this page. If you navigate away from this page without first saving your data, the changes will be lost.'; } }; But when I press the Cancel button on the dialog, I ...

Project JS files

I want to protect my JS files using absolute path of the URL. Please help me. ...

Deployment javascript issue

We deployed the latest enterprise application in windows server 2003. The old virtual directory is not working new java script function. We created the new virtual directory and work all the JavaScript function. Can you please give me some direction. ...

Replace a value if null or undefined in JavaScript

Hello, I have a requiremnt to apply the ?? C# operator to JavaScript world and don't know how. Consider this in C#: int i?=null; int j=i ?? 10;//j is now 10 Now I have this set up in JavaScript: var options={ filters:{ firstName:'abc' } }; var filter=options.filters[0]||'';//should get 'abc' here, it does...

Prototype vs JQuery

Possible Duplicate: Which Javascript framework (jQuery vs Dojo vs )? What is the best? I mean: what I need is simple AJAX features and OOP javascript tools, and manipulation of DOM. Think about the future, popularity and possible extensions or integration with other tools, what is the best choice? Thanks L ...

Clear the cache in JavaScript

how to clear the cache in javascript? We deployed the latest JavaScript code but we unable to get the latest javascript code Can anyone help us? ...

How to access the properties of a JavaScript object?

Hi friend while review a javascript coding, i saw that var detailInf = { "hTitle":"Results", "hMark":"98" }; What's the concept behind this js coding. While give alert for the variable its shows as "[object Object]". So this is an object, then how can we access the variable and reveal the data from this object. ...

autoformat Time in TextBox ASP.Net Javascript

I need to format time like 10:00 PM or 12:23 AM in both 12 or 24 hour format using Javascript ...

auto close a flash file

Is it possible to auto close a Flash banner after it's done playing in a browser? Can it be done through javascript? Or should it be configured in the flash file itself? ...

jQuery's slideToggle does both slideDown and slideUp in IE8 simultaneously

I've uploaded my problem here : http://gotchance.com/k2/ Try clicking on the "Login" link. It works fine in FF and Safari. However in IE8, the form slides down and then slides up again automatically. For testing purpose, i added 4 more "test" links and found that only the links inside #navigation div cause this problem. Also, if i tog...

Delaying a jquery script until everything else has loaded

I have a jquery script which I need to run only once everything else on the page, including some other javascripts (over which I have no control) have finished doing their thing. I though perhaps there was an alternative to $(document).ready but I haven't been able to find it. ...

Variables with respect to DOM

This is surely a JS beginner question. My issue is I want to use the value of the variable type to access the relevant checkbox; however it is treating the variable as a string. I have tried it to two ways. function toggleGroup(type) { if (document.getElementById(type).checked == true){ alert("foo"); } } or function ...