I have a form action that needs to have its value set from a variable. I need to set the variable once and it will be reflected many times throughout the DOM.
So:
variable = "somthing.html";
...
...
I'm doing some straight up asynchronous calls from javascript using the XMLHTTPRequest object. On success, with certain return values, I would like to do an asynchonous post back on an update panel and run some server side methods. This is about how I'm implementing it now:
<script language="javascript">
function AjaxCallback_Suc...
I would like to have alternate behavior during a print stylesheet on a web page. Something along the lines of:
If this page is being printed, don't
bother calling SWFObject to summon an
.swf into existence. Just leave the
HTML that the Flash will replace.
I've tried things like setting a known element to a known style that ...
I would like to shorten very long descriptions to the available table column width. I have the column width information in pixels. Now I would like to convert this measure to the number of characters, so I can shorten the text to the specified number.
I doesn't have to be 100% correct, a near assumption will also work.
...
How can I programmatically generate keypress events from Javascript code running in Safari? It looks like WebKit is using the DOM level 3 model for creating keyboard events from Javascript, and the DOM level 3 keyboard event model does not support the keypress event. Is there another way that I can use?
I'm looking for as pure a Safar...
I can't seem to be able to disable a select box when the select tag is not nested inside a form tag. Some things I tried are (using Firefox 3):
(via Jquery)
$("#mySelect").attr("disabled", true);
$("#mySelect").attr("disabled", "disabled");
(also)
document.getElementById('mySelect').disabled = true;
document.getElementById('mySelect...
I have a ticker which items are updated using polling. I have written a simple jQuery plugin for the ticker which is invoked like so:
$("#cont ul").ticker();
Which turns a ul into a ticker, scrolling through the li. To add new items I have to add lis to the ul, which works fine. However, the OO in me wishes I could have an addItem fun...
IN my case i want to implement multi select auto complete combobox using html,javascript.
Is there any body who knows how to implement it.
Which will be similar to text field shown in stackoverflow while adding multipal tags to any question.
...
Hi,
I'm building a site which will have a 'Login/Register' link on every page. Whenever someone clicks this link, I want a javascript/div based signup form to float ontop of the content with a link to 'close' it if they want.
I also want the capability of the div showing up near the position of their mouse, i.e so if they click the lin...
I have a problem with an object I have created that looks something like this:
var myObject = {
AddChildRowEvents: function(row, p2) {
if(document.attachEvent) {
row.attachEvent('onclick', function(){this.DoSomething();});
} else {
row.addEventListener('click', function(){this.DoSomething();}...
var myArray = new Object();
myArray["firstname"] = "Bob";
myArray["lastname"] = "Smith";
myArray["age"] = 25;
Now if I wanted to remove "lastname"?....is there some equivalent of myArray["lastname"].remove()?
(I need the element gone because the number of elements is important and I want to keep things clean).
Thanks in advance to eve...
I would like to make a simple web app that displays 20 or so images to users and lets them manually sort the images from favorite to least favorite, either by dragging or by using some form of up/down controls, and then submit this ordering. Are there existing tools, either in Javascript or Silverlight, that make this easy?
By the way, ...
I want to use the built-in preference system for my xulrunner (Firefox) application. But I can't figure out how to easily drive the user interface based on preferences.
The user can specify a list of home pages, and each home page will show up in a different tab. Because the tabs are in the presentation layer, I'd like to create them ...
I have a remote JS that must appear in the head of the document. If the server is slow to respond or inaccessible, obviously this slows or prevents the page from loading. I have been searching for a simple way to set a limit of say 3 seconds (probably less) for it to give up and simply not load the functionality.
Does anyone have a si...
Okay, I develop web applications in PHP and Javascript and a lot of times here on SO I have seen the word UNIT TEST passing by, but nowhere on the website have I been able to found a satisfactory answer to what exactly a UNIT TEST is.
So what are UNIT TESTs and should I, as a PHP and Javascript programmer, care, or are they only for 'r...
Problem
How do I capture and assign the events on an Ajax Toolkit autoomplete control using a script control on the script file?
Explanation
I basically created a script control to combine a textbox and an autocoplete control so that I could have a working generic control for an autocomplete. The next step was to add things like a pro...
The following code will generate a link to the page I want to get to.
<%= Html.ActionLink(image.Title, image.Id.ToString(), "Image") %>
The following code will cause the correct url to be rendered on the page.
<%= Url.Action("Index", "Image", new { id = image.Id })%>
But when I try to use it in javascript it fails. (with some stran...
Here's the Question: What is the best way to make sure that your requirement for Flash Version "x" on a site will properly detect presence of later-version Adobe Flash Player Version "10" (or "1y" for that matter)?
Now here's the mystery: Why are so many sites that require Flash Player versions 8 and 9 or better failing to detect Flash ...
I have a website with a form that uses TinyMCE; independently, I use jQuery. When I load the form from staging server on Firefox 3 (MacOS X, Linux), TinyMCE doesn't finish loading. There is an error in Firefox console, saying that t.getBody() returned null. t.getBody(), as far as I understand from TinyMCE docs, is a function that retu...
Such as the
<div class="grippie" style="margin-right: 59px;"/>
on stackoverflow when you post a question or answer. I get a nice css curser which lets me know of the moveable edge but how is the Java script which resizes the field finding out I clicked on the 'Grippie'?
Thank you.
Edit:
Thank you for the answers which lead to Jque...