I want make an 'iGoogle gadgets' that changes the search box on the igoogle page.
Here is my code so far:
<script type="text/javascript">
function bing(){
document.getElementById('sfrm').action="http://www.bing.com/search";
}
</script>
<input type="button" onclick="bing()" value="Search"><br>with Bing.
I have tested it briefly with ...
Is there a way to get the location mouse inside a <canvas> tag? I want the location relative to to the upper right corner of the <canvas>, not the entire page.
...
Hi, I'm trying to use a dynamic, single dialog that changes based on ajax calls. Is there any elegant way to change the height and width based on the new content? Currently, I have an empty div which is filled, causing problems.
Help?
...
I'm not used to writing JS, honestly, and to make matters worse I'm working with the Google Maps API which, while well-documented, is a bear. So, I've written a function that allows a users to zoom onto the map from a link. But the interpreter insists my function isn't defined when I call it. The function is "zoomTo" and it appears in th...
I'm getting reports from my website of weird Javascript errors in a piece of code that normally works well, all with the following user agent:
Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; WOW64; Trident/4.0; GTB6; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.0.30618)
Should I assumed that the IE7 in Windows Media Ce...
I need quite fast methods for playing sounds/ displaying graphics in a web browser. I came across O3D which does nicely for the 2D graphics aspects but as far as I can tell there is no neat way to play audio from a JavaScript function.
My requirements are that multiply sounds be playable simultaneously and also that each sound start to ...
Imagine I have this code:
var myFunc1 = function(event) {
alert(1);
}
var myFunc2 = function(event) {
alert(2);
}
element.addEventListener('click', myFunc1);
element.addEventListener('click', myFunc2);
When the click event is fired myFunc1 is called, then myFunc2. But how do I (if at all possible) stop myFunc2 from being call...
Given remote page:
http://example.com/paged_list.aspx
which uses a Javascript function call to display several pages of tabular data:
javascript: show_page(1)
javascript: show_page(2)
and so on. Users click on the page links to display each page, which triggers a reload but with no query string, ie the URI remains the same.
In scrap...
I'm writing a web application and need to initialize some parameters that I'm pulling via the $.getJSON() method.
$.getJSON("../config/", function(data)
{
console.debug(data);
}
Now since these values will be used globally throughout the script and will not be triggering an event directly (which is the only implementation of $.g...
I have a web application that is using both jQuery 1.2.6 and YUI 2.6.0 and I am thinking about upgrading one or both of these libraries. The current versions (as of this question) are jQuery 1.3.2 and YUI 3.0.0 (beta 1). The main reason for jQuery was the selector engine, and the main reason for YUI was components like TreeView and Dat...
I have a very simple Mac Cocoa app that just has a Web View that loads an HTML file with some CSS and JavaScript. I have hooked up the app delegate to this method:
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
NSString* filePath = [[NSBundle mainBundle] pathForResource: @"index" ofType: @"html"];
NSURL *ur...
In javascript if I have some function I can use the arguments object to look at how many parameters were passed in. Is there a way to call a second function and pass those arguments as if they are just normal separate parameters?
something like this:
function f()
{
g(arguments);
}
function g(a, b, c)
{
alert(a+b+c);
}
So in this cas...
Hi All,
How do you ensure that your javascript includes get included properly for all files everywhere using a particular layout? Basically I have some non-restful actions that I've added. I haven't added any ROUTES for them, however, using normal text rendering works fine. It's when I start requiring different "swf" and "js" files (...
It would be exceedingly handy if I could do this:
var MyObject = function(param1, param2, ... paramN)
{
this.var1 = stuff;
this.var2 = moreStuff;
.
.
.
this.varN = nStuff;
this.validate = function()
{
for(var current in this)
{
alert(current);
//validate all member...
so I'm finally understanding prototype and how to use it.
I'm sure that I'm still trying to solve this as a java inheritance problem, so if there is a more prototypal way to go about this let me know.
If B inherits A I want B's constructor to first execute A's constructor. This is important for setting up B's local variables. At first I...
Hi folks,
How to add class for the ('div');
var new_row = document.createElement( 'div' );
...
I am using some pre-written JavaScript from polldaddy.
They have a JavaScript option which, when you click on the link, the survey pops up as an overlay to my site.
However, I would like when people come to the site, the overlay comes up on its own without needing to click on the link.
Here is the JavaScript:
<script language="javasc...
I want to make the titles of WordPress blog posts appear on a seperate homepage like they do at Apple.com next to "Hot News Headlines".
Here is the related source I found but I am unsure how to apply it to my own site:
<link rel="alternate" type="application/rss+xml" title="RSS" href="http://images.apple.com/main/rss/hotnews/hotnews.rs...
hello,
I am trying to apply a method to an existing object which involves using its private variables. The object is setup like so:
function a(given_id)
{
var id= given_id;
}
now I want to apply some new method to it like so
my_obj = new a('some_id');
my_obj.myMethod = function(){
alert(id);
}
now if I go my_obj.myMethod() ...
What I want is this: http://www.freeimagehosting.net/image.php?11b1fcb689.png
Edit: Added a fuller picture of what I'm trying to do. I can make it look right using absolute positioning, but when the window size is too small, the content slides off the page without a horizontal scrollbar. That's why I want to use relative positioning f...