Hi, I'm trying to get the current URL that the Flash player is on. Not the URL of the .swf file, but the URL that the browser is pointing to. Thus far I've used:
var st:String = ExternalInterface.call("window.location.href");
Unfortunately this doesn't work in IE. From my research, I can see that it won't work with IE either way.
The...
I have a bit of javascript that I am using to calculate the y-scale of a graph. I need to adjust the scale according to the value. This works but seems really verbose. Is there a more streamlined way to do this?
if (maxValue <= 20000){
chartMaxY = 20000
}
if (maxValue <= 10000){
chartMaxY = 10000
}
if (maxValue <= 5000){
chartMax...
Using asp.net, c# 3.5, vs 2008.
I have an aspx gridview called gv1 with a working c# codebehind onrowcommand method which is called when a button on the row is clicked.
The button on the gridview is being dynamically generated.
I am trying to replace that codebehind call with a javascript function to avoid a roundtrip to the server....
I want to open a file dialog via FileReference.browse() but I get #2176 error which means that this action can only be invoked upon some user interaction. I'm aware of security considerations but in my scenario I have a thin flash movie which merely displays an image and the whole UI is in javascript (I heavily use javascript <-> actions...
The jQuery Autocomplete plugin relies on an odd response format. Specifically, it's a newline-separated list of pipe-delimited pairs, the first entry of each pair being some formatted text, the latter being a JSON object with some data.
An example:
Fuzzy Bunnies|{ id: '1234-fuzzy-bunnies', type: 'slippers' }
Loud Hawaiian Shirt|{ id: '...
I can't believe I've never done this before....
Here's my situation: I am using 2 jQuery plugins. Shadowbox and validate (bassistance).
I click on a link to sign up for a newsletter. The link opens a form in a shadowbox. No biggie. The form is validated with the plugin.
When the form is validated and ready to submit, it doesn't.
...
I have next and previous links in the html
<a href="/event-sort/calendar/2009/9/sports/">prev</a>
<a href="/event-sort/calendar/2009/11/sports/">next</a>
When they are clicked, I want the page to make an ajax call to load a php script that will update the calendar's html
now when the calendar updates, the arrows have been removed and...
I'm trying to preload about 200 images using the following:
var total_images = 0;
var loaded_cnt = 0;
var tempImg = new Object();
function precache_array(a,path){
for(var i = 0; i < a.length; i++){
tempImg[path + a[i]] = new Image();
tempImg[path + a[i]].src = path + a[i];
tempImg[path + a[i]].onLoad = image_loaded(a...
I have a rather long running javascript code which adds a new "div" element to the document. It looks like in IE this change is being rendered only after the script is finished, which is not the case in FF.
Any idea how to make it work ? This script is actually supposed to run forever, kind of "main loop".
...
A little odd situation. I'm writing a greasemonkey script on some legacy HTML where everything is put into one table. I want to select all TR elements from the one I click and the next 3-4-5-6 rows up to the next row that contains a TD.class_name
table
...
tr -> td.class_name
tr
tr
tr
tr -> td.class_name
...
/table
So, i...
You can see an example here: http://alboard.free.fr/adrien/test.html
The layout is based on horizontal scrolling (the red element). But I want the top part to be fixed (the blue element).
If the user resizes the viewport, a vertical scrollbar will appear. If at this point the user scrolls down, the red element will go up while the blu...
Javascript can manipulate the document the browser is displaying, so the following:
<script>
document.write("<table><tr><td>Hola</td><td>Adios</td></tr></table>");
</script>
Will make the browser display a table just like if it was the original HTML document:
<table>
<tr>
<td>Hola</td>
<td>Adios</td>
</tr...
Hi
I am just trying to get this plugin to work but I am not sure what I am doing wrong.
http://code.google.com/p/sevenup/
So I tried to follow the one like of code they give you.
<script type="text/javascript" src="sevenup.0.3.min.js"></script>
...
<body onload="sevenUp.test( options, callback );">
My test page.
<html xmlns="http:...
I want to manually trigger validation including showing error messages with jQuery Validate.
The scenario i am trying to accomplish is a form like this:
<form>
<input id=i1> <button id=b1>
<input id=i2> <button id=b2>
</form>
When clicking b1, only i1 should be validated. hen clicking b2, only i2 should be validated. However all fi...
I am a novice Javascript programmer; any help would be greatly appreciated.
I have successfully implemented a script that allows users to switch from a "regular view" to a "high contrast view". The script is simply changing stylesheets.
I have also set up the script with a basic toggle: when a user clicks "High Contrast View" the li...
I have several checkboxes and a fake submit button to make an AJAX request:
<form>
<input type="checkbox" value="1"/>
<input type="checkbox" value="2" checked="checked"/>
<input type="checkbox" value="3"/>
<input type="checkbox" value="4" checked="checked"/>
<input type="button" onclick="return mmSubmit();"/>
</form>...
I have a web page with a number of iframes, including 3rd party iframes like ad sense and various sharing buttons.
In Firefox, I've noticed that occasionally the content of these iframes get swapped, such that you'll get an ad sense ad where another iframe is. It seems completely random where iframe content shows up. It seems it may ha...
What is the simplest/cleanest way to implement singleton pattern in JavaScript?
...
This question brought a new one:
I have a html page and I need it to change the content type when the user press "save" button so the browser prompt to save the file to disk
I've been doing this in the server side to offer "excel" versions of the page ( which is basically a html table )
<c:if test="${page.asExcelAction}">
<% ...
If I add this piece of html to my page:
<script type="text/javascript">
var s = '</script>'
</script>
IE 7.0 shows a syntax error (exclamation mark in left bottom corner): "Unterminated string constant"
if I change just one letter (any) the error disappears - looks like IE doesn't like this particular word, including brackets.
Any ...