Hi,
I have to make a web application using GWT. The project has a core module that'll expose a set of apis to be used by other apps; each of these app are unrelated. Each shall be loaded in a separate iframe.
My idea was to compile core into core.js and each app shall have its own app1.js app2.js and so on...
App1
script type="text/...
I have two divs, one that holds some stuff and the other with all possible stuff. Clicking on one of the divs will transfer items to the other div. The code I came up with is:
$("#holder > *").each(function() {
$(this).click(function(e) {
$(this).remove();
$("#bucket").append(this);
});
});
$("#bucket > *").each...
I have an array that I need to unpack.
So, from something like
var params = new Array();
params.push("var1");
params.push("var2");
I need to have something like
"var1", "var2".
I tried using eval, but eval() gives me something like var1, var2...i don't want to insert quotes myself as the vars passed can be integers, or other type...
I'm currently writing a Greasemonkey script for a page, so I can't modify the script myself.
There is a form submit button on the page. When you click this button, it executes some fancy AJAX calls and such to update the page and do serverside things. What I'm trying to is basically set a "lastClick" value when the button is clicked.
...
Can someone help me fill in the blanks with native JavaScript?
function getHeading(lat1, lon1, lat2, lon2) {
// Do cool things with math here
return heading; // Should be a number between 0 and 360
}
I've been messing around with this for a long time and can't seem to get my code to work right.
...
hi all,
I'm using jQuery to parse some XML, like so:
function enumOptions(xml) {
$(xml).find("animal").each(function(){
alert($(this).text());
});
}
enumOptions("<root><animal>cow</animal><animal>squirrel</animal></root>");
This works great. However if I try and look for nodes called "option" then it doesn't work:
fu...
I have a list like this:
<ul>
<li id="adm-thumb" onclick="javascript:addBanner('bowling.jpg');">
<div class="adm-tick"></div>
<img src="img/banners/bowling.jpg" /></li>
<li id="adm-thumb" onclick="javascript:addBanner('kcc.jpg');">
<div class="adm-tick"></div>
<img src="img/banners/kcc.jpg" /></li>
...
hi i have a script
<script type="text/javascript">
window.addEvent('domready', function(){
var totIncrement = 0;
var increment = 560;
var maxRightIncrement = increment*(-6);
var fx = new Fx.Style('slider-list', 'margin-left', {
duration: 1000,
transition: Fx.Transitio...
Hi all,
I would like to know if it's possible to use javascript to open a popup window containing an image, and at the same time have the print dialog show. Once someone clicks on print, the popup closes.
Is this easily attainable?
...
I have the following code for my optin form:
<script language="JavaScript">
function checkSub() {
if (document.signup.email.value.indexOf('@', 0) == -1) {
alert("Please fill in your valid Email address.\nYour email should be in the following format: [email protected]");
document.signup.email.focus();
return f...
Is it possible to determine if Google Chrome is in incognito mode via a script?
Edit: I actually meant is it possible via user-script, but the answers assume JavaScript is running on a web page. I've re-asked the question here in regards to user scripts.
...
Hello,
a few weeks or months ago a (I think jQuery plugin) wizard was released,
which allows you to do interactive "tutorials".
You were able to create interactive boxes which relates to html elements and you were able to change to color of these boxes to red.
It's also possible that it was "just" a javascript script and not a jquery pl...
My question is, is there a way to make this code more efficient or write it in a simple way? javascript by the way.
switch (tempvar1) {
case 1:
currentSlide = 'slide1';
showaslide('ppslide1');
break;
case 2:
currentSlide = 'slide2';
showaslide('ppslide2');
break;
case 3:
currentSlide = 'slide3';
sho...
I would like to find all occurrence of the $ character in the dom, how is this done?
...
Hey Gurus,
I am working to use IE Dom interface to automate IE page access. I am trying to get all event handlers defined in a page. I am using IHTMLElement object now for this purpose. If the html page defines "onclick=xxx", element.onclick returns the click handler. However, if an event handler is defined in javascript, element.oncl...
I want to change JavaScript alert title header from displaying Internet Explorer to another name. is a way to do it?
I found these site in the net:
http://bytes.com/topic/javascript/answers/148721-change-title-bar-javascript-alert-box
http://stackoverflow.com/questions/1905289/how-to-edit-a-javascript-alert-box-title
Which say that t...
Let's say we have this markup:
<span href="">Text <a href="">Link</a></span>
We have events bound to both elements. How do I make it such that when I click on the anchor tag, the event on the parent will not be triggered? I've tried using the Jquery method stopPropagation() but still no luck. Any thoughts? Thanks.
...
re,
I have a simple query that works:
$("#test > fieldset > input").each(function() { })
However, I want to select "input" and "select" elements without having to write 2 "each" queries. Is this possible?
thanks.
...
I have the following function:
listorder = listorder.replace('projectlist-','');
Problem with this is it only finds and replace the first instance and there are many. How can this be updated to Find/Replace All instances in the string?
Thanks
...
I'm having a strange issue with my Javascript in Firefox 3.0.x. In Firefox 3.0.12, the page constantly reloads as soon as the list body is loaded. Neither Firefox 3.5, Safari 4 nor Chrome 5 (all on Mac) experience this issue.
EDIT: I've created an isolated example rather than pulling this from my existing code.
The issue was related t...