What is the difference between functions within an object. I have 2 examples which basically do the same thing.
function a(param) {
function b(input) {
return input%10;
};
return 'The result is ' + b(param);
};
and
function a(param) {
this.b=function(input) {
return input%10;
};
return 'The result is ' + this....
I'm building a Drupal module that integrates the "FileCatalyst" Java FTP applet with a standard Drupal form. I'm implementing a hook to submit the form when a file transfer completes. Currently I'm polling the applet with a setTimeout() call, but this method can miss changes of state if they happen too fast.
However, the FileCatalyst ob...
I'm using SimpleModal (http://www.ericmmartin.com/projects/simplemodal/) and I have a form that displays in a dialog. What I want to do is be able to have a confirmation come up each time that the user tries to close the dialog (either by escape or clicking on the close icon) and asks them if they really want to close it without saving t...
Hi guys.
Well i first wrote a Javascrip function that would change the text in a textarea according to the selection you made in a dropdown box, a really simple thing.
HTML
<form name="formconteudo">
<select name="selectpage" onChange="change();">
<option value="1">something</option>
<option value="2">another thing</option>
<option va...
I have an iframe on my main page, and this iframe uses php code mostly (src is php file).
At the bottom of this iframe I have this:
window.parent.document.getElementById("qry_str").value='hey';
And in the main (parent) file, I have this hidden input which I am trying to set from the iframe with js:
<input type="hidden" i...
I have a form with many inputs, but not all inputs must be filled in.
Form action is set to a php file, which checks which inputs are set and builds a query to query MySQL.
Then I display the results on the main page, and the users may click on an ad to show.
When clicked an ad, a new page opens with several options for the user (chang...
imagine that we have loaded a complex website with lots of Javascript which loaded all sort of info via AJAX and by making computations based on user input. So, now suppose we want to archive it in such a way that we can reliably load it later on from file (maybe even without an internet connection) and study its behavior / debug it / et...
Hello,
title is pretty clear.
My websites consists of both English-written and Spanish-written versions.
You can go to the main site, which is in Spanish, by clicking http://www.chrishonn.com and to the translated version, which is in English, at http://en.chrishonn.com. At the index of each page there is a link (at the bottom) which al...
Exposition:
I'm familiar with C/C++/Scheme & OpenGL. I have this client/server program written in Clojure that serves as a todo-list/wiki/forum. The server is written in Clojure. The client is written in Clojure and uses SWT.
Question:
I want to rapidly create a web client version of this. What is the best way to do this? (I Don't use...
Does anyone know how can I remove the semicolon (;) from the string by using JavaScript?
For example:
var str = '<div id="confirmMsg" style="margin-top: -5px;">'
How can I remove the semicolon from str?
...
I'm using Google Maps with API v3. I will add many markers, now got question, is there posibility to group markers? For example, by city? I'm using a small snippet to creating sidebar with markers buttons.
Here's the code:
/**
* map
*/
var mapOpts = {
mapOpts: new google.maps.LatLng(60.28527,24.84864),
mapTypeId: google.maps.MapT...
This is what I've tried:
html:
<div id="container">
<p>a paragraph</p>
</div>
<button>replace with link</button>
script:
$(document).ready(function() {
$("a.foo").click(function() {
alert('hello world');
});
function foo() {
alert('hello world');
}
$("button").click(function () {
...
Hi,
I have been having problems simply adding more than 2 views to the stack through the Dashcode GUI interface. I have seen how to do that programmatically, but is there a way to statically keep extra views within the stack?
I am actually okay with using a different stack, but the problem there is that I have to add another browser ar...
Hello all,
I am making use of JQuery to fire off an AJAX request. As soon as that PHP script is initiated I want to redirect my browser to a different page. But the AJAX request must have been fired off successfully, it doesn't matter what that scripts returns. Currently I do the following, but it redirects instantly whilst the script w...
Hi.
I have a page where in Javascript I add to the location hash something like:
location.hash = "initial_source=previous_referrer".
Afterwards a window.location is done in order to redirect.
However the receiver gets the referrer in his request without the hash (#) part.
Is it possible to somehow modify the URL in the initial page...
hi,
i can't close the info window of the marker i'm dragging, any idea ?
Thanks for your help
function mapClick(event) {
createLocationMarker(event.latLng);
}
function createLocationMarker(location) {
var clickedLocation = new google.maps.LatLng(location)
var gMarker = new google.maps.Marker({position:location, map:gMa...
Here is code on view in FeesController "show" action template:
<div id="payers_controls">
<%= link_to_remote('New payer',
:update => "payers_controls",
:url => new_payer_url)
%>
</div>
Here is new.rjs - belongs to PayersController "new" action
page.replace_...
I want to put endless scrolling (either the load more posts button or the scrolled to the bottom of the page type) onto my tumblelog. There's a theme that does this but I don't know how it does it.
Any help is appreciated.
...
function SlideObject(Side) {
$("#div").animate({
margin+Side: "-1000px",
opacity: "hide"
}, 1000);
}
I would like to pass the value for "Side" into the name of property identifier (margin) for the animate function.
I am aware that "margin+Side" is not valid it is just there as a place holder. For example if I ...
Hi Everyone,
Edit : Problem wasn't related Event Propagation, if you want to know how to stop propagation in jQuery, then use event.stopPropagation();
When user moves his/her mouse over <span> element my jQuery code appends an <img>into this <span> element and when he moves out his mouse off <span> than the element appended is removed....