Tagged Questions
JavaScript is a dynamically-typed language commonly used for client-side scripting. Use this tag for questions regarding ECMAScript and its dialects/implementations (excluding ActionScript). Unless a tag for a framework/library is also included, a pure JavaScript answer is expected.
1
vote
7answers
48 views
Can someone please explain e = e || x? Why assign e to e?
Can anyone explain what this statement means?
e = e || x
Specifically,
e = e || window.event
This appears in a chunk of code I am looking at.
I'm not at a complete loss, however My ...
0
votes
3answers
26 views
save array values on reload and retrieve it back
I am pushing some random values in an array every minute.
onreloading I want to retrieve back these pushed content and keep pushing some random data every minute?
I am using local storage.
...
-1
votes
1answer
10 views
yii - how to redirect after 10 seconds
I am new to the yii framework, and I can't see to find any information or forums about how to redirect after 10 seconds has pass on a page. for example after resetting your password, I would like to ...
0
votes
0answers
4 views
breezejs v1.3.6 breaks my application
I've updated my client library and server web api dll to latest version.
Now whenever I do an expand on a query, I get that kind of error:
unable to locate property: Mandate on type: ...
0
votes
0answers
15 views
How to make an array of objects reactively update on the page when new elements are added to it?
I have an array of objects. Say
var
sidelist = [
{
name:"asdf",
id:1234,
types:[...]
}
];
Every object is turned into a box on the page using this construct
...
0
votes
0answers
18 views
How can I snap javascript generated elements to their nearest possible defined coordinates without overlapping others?
I have an array of elements with percentage coordinates which are positioned on a page by javascript which are positioned absolute and are placed using left and top attributes, with negative ...
0
votes
0answers
14 views
Trigger onmouseover without moving mouse
So here's the deal.
I'm making a card-playing framework on a web page. Let's say I have a deck where players can draw cards from, taking turns. When it's your turn, I will add onmouseover, showing a ...
0
votes
0answers
6 views
History.js scripts, .on() etc
I'm playing around with history,js, in fact, I'm using Ajaxify too https://github.com/browserstate/ajaxify
So got the basic pages up and running and the scroll back to the top works fine.
So I'm ...
0
votes
0answers
12 views
Flat UI Checkbox Styling Not Working
I'm writing a rails application and styling with Flat UI. I'm currently using the flatui-rails gem in conjunction with the twitter-bootstrap-rails gem. Everything is working fine except when ...
0
votes
1answer
12 views
How to track form submission in IE with bootstrap modal window?
I have a form that the user fills out and gets submitted through jquery using $("form").submit();
while the form is submitted I use a modal window from the twitter bootstrap library to disable the ...
0
votes
0answers
11 views
Can I use different js file for different site orientation?
<link rel='stylesheet' media='screen and (orientation:portrait)' href='css/portrait.css' />
I have entirely different layout for portrait and landscape orientation. Could I use a specific ...
1
vote
0answers
3 views
Enabling/disabling legend and its corresponding row onclick in Google charts
My requirement is,
After a google chart gets loaded, if I click the legend, the legend should be grayed out and its corresponding value in the graph should be removed.
When I click the grayed out ...
0
votes
3answers
43 views
how to edit a js object/function
Hi i am using an api but i should make a patch for it
Songapi.prototype.goPlaySong=Songapi.prototype.goPlaySong.toString().replace('["universal","emi","warner"]) !== -1','false');
doesn't work
also ...
0
votes
0answers
6 views
Cannot close popup window when a button is pressed using javascript in Google Chrome
I have used to create a a popup window to compose a message and the problem is I want that popup window be closed when a button on that popup window is click.
below is the code that I used to close ...
1
vote
1answer
42 views
Apply method to variable
I am trying to add a method to a variable to be used as following;
var method = ".wrap";
jQuery('.container')+[method]+("<div>Hello World</div>");
Essentially what it should do is;
...
0
votes
0answers
4 views
How do I add coffeescript generated source maps to eclipse?
I'm using Appcelerator's Titanium Studio which is Eclipse setup to edit and debug JavaScript out of the box. I am also writing CoffeeScript and having the generated files placed into the projects ...
0
votes
1answer
11 views
Click event on select doesn't work on macs
I have a <select> that would like to respond to a click event (using javascript).
On MacOS Chrome, no event is fired on click. This is a known problem (e.g. 1, 2, …)
Example
<select ...
-1
votes
0answers
24 views
Works on chrome but not on IE
I have set up a couple pages that link each other. I have one page which is seen as the "product page" made up of a slideshow with images, description and thumbnails using jQuery. Each product has a ...
0
votes
0answers
2 views
Can Pinch Open javascript event be used in Adobe DPS article?
Within an Adobe DPS article, I have a scrollable frame with text. I want to pinch the frame and open an html article that has the same text with javascript formatting options, such as ...
0
votes
0answers
5 views
Angular data in dropdown not set the second time
I've something weird going on here with Angular.
I have a details view with an edit button. When I press the edit button, I pass the object to the edit view. On the edit form there are a few dropdown ...
0
votes
0answers
6 views
Backbone.js: smart update of a list of changed attributes
I know this problem have been discussed several times, but I could not find an answer to one of its many aspects, that I'll try to explain here.
Model save() keeps sync between client and server. ...
-1
votes
1answer
24 views
Instant updating UI elements using javascript
I know maybe this is not possible.
I have searched the web but without suceess
I have a while loop and I want to do two things:
Update a textarea with formatted information
Update the width of ...
1
vote
1answer
34 views
Get name of function in javascript
How can I get the function name inside a function in Javascript?
Specifically in Dojo, as this doesn't seem to do the job
arguments.callee.caller
0
votes
2answers
29 views
remove object from array with just the object's reference
Suppose I have an array of objects called MyArray and that a certain function returns a reference for a particular element within that array; something like this:
MyArray = [Object1, Object2, ..., ...
1
vote
1answer
13 views
Difficulty setting focus on newly created object in javascript
So, related to an earlier question, but forgive me for my naive javascript ways. Basically I now want to automatically bring a text input into focus when it is added to the DOM. Part of me thinks that ...
0
votes
4answers
41 views
issues with “jumping” using anchor tags
There seems to be a few subjects on anchor tags but I am missing something on how to use Javascript to use an anchor tag without the jump. So my page is loaded and I have a div that holds 2 charts ( 1 ...
0
votes
1answer
30 views
How can I send parameter to main page in frame?
I want to send parameter in frame to main page.I use javascript.
Thanks.
0
votes
1answer
15 views
Setting baseUrl for img tag in HTML fragment
I retrieve, with an ajax call, an HTML fragment which include some tags. These tags have a relative src URL and I want to set, for these tag only a base URL, different from the base path of my page.
...
0
votes
1answer
18 views
Modify pseudo element from field value with jQuery/JS?
I know that jQuery cannot directly manipulate CSS pseudo elements, and I've already read a bunch of posts here that don't answer my question.
I need to modify the CSS of a pseudo element with the ...
0
votes
0answers
8 views
knockout mapping JSONP server
I have installed knockout and I would like to mapping elements using Jsonp.
function showEmailsUsers() {
var dataToSend = {
pinNumber : pinNumber
};
$
.jsonp({
url : ...
0
votes
1answer
20 views
Best method for preventing flooding of comments
I have a commenting system that I build which is similar to typical social media like Facebook. The user can post a comment beneath a thread. As it stands, someone could type something and hit enter ...
2
votes
6answers
56 views
URL parameters with PHP
Are there ways to pass variables in a URL similarly to GET data? For example, with slashes?
I currently have a single .php file which reloads a div with different content using javascript to navigate ...
0
votes
0answers
2 views
jVector map resetting region colors (initial, hover, selected) after initializing
I need to change the region colors in my map after initialization, which I've initialized as :
stateMap = new jvm.WorldMap({
container: stateMap.$map,
map: 'us_nji_en',
zoomOnScroll: false,
...
3
votes
1answer
19 views
Minimalistic play() and pause() audio solution
I found a little code snippet within another question, playing an mp3 just with jquery play() and pause():
<a href="#" rel="http://www.uscis.gov/files/nativedocuments/Track%2093.mp3"
...
0
votes
0answers
11 views
How do I get the current NotesDocument using Javascript?
In a Lotus Notes Project it's simple to access the current document automatically in the QueryOpen method for example, extracting it from NotesUIDocument, which is a parameter.
Sub Queryopen(Source ...
0
votes
0answers
6 views
ScriptDb.getSize() returning incorrectly in an object
I have a Apps Script function that makes a generic ScriptDb call based on queries passed to it and returns an object containing a count for the query and the ScriptDbResult object itself:
function ...
0
votes
0answers
21 views
Javascript solution for notifying user that their browser is unsupported [on hold]
We have a bespoke web application for which we only support (from a business perspective) a pre-defined list of browsers.
Although the application, may function correctly, I need to provide users ...
0
votes
0answers
8 views
Facebook explicit sharing using Javascript api?
I recently received approval for explicit sharing on an openGraph action. All the examples on FB and everywhere that I have seen use CURL to pass the explictly_shared parameter
curl -X POST ...
0
votes
1answer
23 views
Get star rating from number using jquery
Here I have code to convert number(rating) into stars using http://wbotelhos.com/raty, http://wbotelhos.com/raty/lib/jquery.raty.min.js
I create an jsfiddle: http://jsfiddle.net/3SXKe/4/
// mocking ...
1
vote
3answers
18 views
Accessing Selected Value from a Pulldown menu
I am having trouble in accessing the selected value from a dropdown menu. When I try to access the value selected in the javascript function displayPhoto, no value is being accessed at all (I tried to ...
0
votes
0answers
19 views
JQuery add pagebreak (like Google Docs or MS Word) and go to next page
Hi i need to create function to add pagebreaks like Ms Word with header and footer:
This is my code:
<script>
$(document).ready(function(){
var page = function({
...
0
votes
0answers
20 views
Using jQuery's ajax method to retrieve images as a blob
I recently asked another (related) question, which lead to this follow up question:
Submitting data instead of a file for an input form
Reading through the jQuery.ajax() documentation ...
0
votes
0answers
6 views
Enabling PayPal buttons with a checkbox
Im kinda of a nooobie when it comes to coding, but here it goes, hope someone can help. I was asked to set up a payment page using two paypal buttons. When you first arrive at the page the buttons ...
0
votes
0answers
4 views
Providing a Protected Global API to Third-Party Widgets
I am creating a Web Application which provides a global Javascript-based API (in the variable System) and it includes methods that will be provided by frameworks (stored in System.Frameworks[name]).
...
0
votes
1answer
20 views
Browser Details from javascript without using ActiveX controls
If i am using "window.navigator.userAgent" or "$.browser" then these are asking me to allow to run the ActiveX controls But My application should not use any of ActiveX controls. Can anyone help me to ...
1
vote
1answer
63 views
How to move functions outside a loop
JSHint is screaming that functions should be declared outside the loop, I'm just confused on how to do this? The specific part: self.onchange = function () {...}
Here's the loop:
for ( var j = 0; j ...
0
votes
2answers
44 views
Custom styled checkbox not working properly
Currently I'm using multiple blocks of the following code as my custom styled checkbox:
<div class="row-fluid">
<div class="span12 card card-even">
<div>
...
0
votes
1answer
17 views
Validate inputs with a certain name using JavaScript
I want to get the inputs inside my form that has a name starting with this_form_. I have a loop creating my inputs so I don't know how many they are. And I have other inputs in the form that's not ...
1
vote
1answer
23 views
How to add class for all parents of one siblings element with jQuery
I have this markup:
<li class="parent">
<span class="button"></span>
<li class="parent">
<span class="button"></span>
<li class="parent">
...
1
vote
2answers
12 views
Get value from JSON string from Google calculator api
I found this SO post about currency convertions.
I am new to JSON so my question is how to send and get the result from this url into variables?
...