Hi
I have this code
function initialize() {
var myLatlng = new google.maps.LatLng(xx.xx, xx.xx);
var myOptions = {
zoom: 11,
center: myLatlng,
scaleControl: true,
scrollwheel: true,
disableDoubleClickZoom: false,
mapTypeId: google.maps.MapTypeId.TERRAIN
}
var map = new go...
When using mouseover a thumbnail of orientation, the image width and height did not fit exactly into "imax", a Div element.
I use the code in HTML Image:
onmouseover='chgImg(this.src)' onmouseout='resImg()'
and Javascript and CSS:
function chgImg(asd) {
oim = document.getElementById("im").src;
return document.getElementById(...
I am looking for a way to detect cmd+r and cmd+w (also ctrl+r and ctrl+w) in my application.
This site does it http://gpl.internetconnection.net/vi/. The source is a nightmare though. If I don't find a quick answer, I'll look through that.
Does anyone have a link or example?
...
suppose we have a pdf link "http://manuals.info.apple.com/en/iphone_user_guide.pdf"(just for example and to let u know that file is not on my server, i only have the link)...now i have to provide a button on my site that will download the file.
i have tried various things like window.open, href etc. methods but it open the link on other...
Here are two test files:
http://gutfullofbeer.net/good-table.html
http://gutfullofbeer.net/bad-table.html
The markup on those two page is all almost the same. There's a table with two columns. The <th> and <td> elements of one column (the second one) are all given the class "junk".
In the "good" page, when you load it you'll ...
I'm just reading a bit into JavaScript and came over some code that handle the process of loading images:
var n = 0;
...
for (...) {
...
image[i].onload = function { n++; };
}
Is this piece of code safe or can there be any type of race while accessing the variable n?
...
I'm writing an extension for Firefox that involves using a link to a site that redirects to another. After it redirects I want to alter the url in the address bar. Any ideas on how to do this?
...
Say I got this singleton object with some public methods and one private method:
var QuestionFactory = (function() {
// private method
function google_it_first() { ... }
// public methods
return {
ask_a_stupid_question: function() { ... },
ask_a_relatively_non_stupid_question: function() { ... },
ask_a_difficult_q...
Currently I have a simple form with a plus and minus on it and a value in the middle. I am trying to create a href link under the plus and under the minus to call self but to either indicate which link was used (either plus or minus) or to pass the value after being incremented or decremented.
I do not want to use JavaScript/client side...
I've got a variable that holds a number of miliseconds which represents the timespan from now to a specified point in the future.
I want to convert this milisecond figure into a timespan value I can display to users.
I know I can do this the native way with modulo arithmetic and manually displaying the result to the user, but I want to...
Is there a way to embed a font in the html / javascript code? (everything in 1 html file)
...
How do I detect the change if I have mouseover a thumbnail image, the main image will replace with the thumbnail, I believe onLoad() does only fire once.
...
Is there a way to geometrically compute the intersection points of a line and an arbitrary graphics path? I know where all of the lines and curves are in the path, and I am using the HTML5 canvas element if that helps any. Basically, I have access to all of the canvas drawing commands and their arguments. For instance, if the API was c...
I want to unit test the javascript I have embedded in the webapp portion of my liftweb project. Liftweb is a subset of the maven webapp archetype, so my question applies to that framework as well.
By 'good', I mean that the tests can be integrated into the maven automated testing.
I understand that different browsers support different...
How do I catch all links and button pressed?
Without having to add my JavaScript method to every link and button?
Anytime my browser wanrs to redirect to page1.aspx
stop it from redirecting and have mt browser click a link found on the page to page2.aspx
instead!
...
Hi,
I have just started learning Javascript. I want "Hello World!" to be written to a webpage once a user clicks a button. I have tried this:
<html>
<head>
<script type="text/javascript">
function displaymessage()
{
document.write("Hello World!");
}
</script>
</head>
<body>
<form>
<input type="button" value="Click me!" onclick="displa...
Turns out jQuery's "implicit looping" goes both way:
<div class="classOne">
some content
</div>
<div class="classOne">
some content 2
</div>
[...]
$(function() { $('hello world').prependTo($('.classOne')); })
in this case, the loop will happen at the $('.classOne') section -- hello world will be ad...
For a simple utility I'm working on, I need a script that converts a given decimal value to a 32bit floating-point hexadecimal value. For example, I know 1 is 3F800000 and 100 is 42C80000, however I don't know how to return these results with any number. If somebody knows a simple formula or even a complex way to go about doing this, ple...
I have written a Userscript for Facebook and it groups similar notifications together. Now, using just a static HTML page with old notifications I had, the script works 100%.
Here's the problem: the DIV that holds notifications by default, has no notifications in it until the user clicks on the Notification button. Facebook has an inlin...
I am trying to prevent text highlighting in Firefox for some, but not all elements on the page. Consider the following:
<div style="-moz-user-select: none;">
I cannot be highlighted
<div style="-moz-user-select: text;">
I should be highlightable, but am not.
</div>
</div>
As I understand it, using the above css rules, th...