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.
0
votes
0answers
13 views
Javascipt calculate value from column dynamically
Sorry in advance if my english is not correct :)
I just learning about javascript, and i want to try calculate value in table column like this :
NameOfField1 || Value1 || Value2 || Value1 * Value2
...
0
votes
0answers
16 views
How to make Dynamic graphs in javascript
I want to make a dynamic graph that its data changes based on the current time. I have a json file and I want to do it with javascript and d3.js but I do not know how to show the current time changes ...
0
votes
2answers
27 views
Ghost element in javascript
So I've been designing a remember me button using cookies, and I made two functions to do so:
function checkInfo() {
var blah = $("#remem");
alert(blah.id);
var login = $("#nameInput").val();
var pw ...
1
vote
0answers
9 views
How to get the character corresponding to a Unicode character name?
I'm developing a Braille-to-text translator, and a nice feature to have is showing an output in Unicode's Braille patterns characters (say, kind of a Unicode Braille generator).
Since I know the dots ...
0
votes
0answers
8 views
How to use getUserMedia to upload video file into a database?
I Know People say not to do this but i'm Just Playing around with new things to see if is possible.
I found this code :
<script language="javascript" type="text/javascript">
function ...
-1
votes
0answers
25 views
Bootbox alert not work? [closed]
I have read example from home page bootbox but i can't run it . Please help me !
This is my script
<script ...
0
votes
0answers
12 views
countdown timer only work for the current server time
Here is the countdown timer which i have used http://keith-wood.name/countdown.html
I'm trying to let the countdown timer only work for the current server time
They have talk about that in the "Time ...
0
votes
0answers
4 views
Retrieving data from sessionStorage reloads entire page.
I am building a web app that uses sessionStorage. When I load my JSON feeds data initially, I add it to the storage and Stringify the feed before setting the value.
Before I load a new JSON feed I ...
0
votes
0answers
5 views
AngularJS: POST Data to External REST API
I have a basic AngularJS service setup like so:
app.factory('User', function($resource) {
return $resource('http://api.mysite.com/user/:action:id/:attr', {}, {
history: {
method: 'GET',
...
0
votes
0answers
13 views
django - getting value from a field which is hidden in html and using it in views file
I am working in django and i want to set a value to a hidden field in html and use it in django view file
html file
<input type="hidden" id="t" name="t" />
<script>
...
0
votes
2answers
19 views
Cannot reset setInterval in JS
I want to do something continuously while the mouse is being held down, and stop it once is it released. So I have the following code:
var timeout;
var y;
$(document).mousemove(function(event){
y ...
0
votes
3answers
38 views
Using REGEX inside an IF function
I am trying to validate zip codes using an if function with a regex. Can this be done? I currently just have the if function making sure the zip code is 5 numbers.
below is the regex i want to use
...
0
votes
0answers
9 views
Image access monitoring
Is there any way to monitor image access by user. My website is having few images. But I want to run particular script on access of image by user if user access image directly , e.g
...
0
votes
2answers
36 views
Inserting javascript with jQuery .html
I'm experiencing an issue with a website I'm working on, where I originally believed I could simply replace $("main").html(this) which was originally code for a flash object, with a new and improved ...
0
votes
0answers
10 views
Supersized image captions - render outside of JavaScript
I am using the jQuery supersized script for a full screen slideshow (not the WordPress plugin as this didn't give me enough control). However, one issue that I am trying to tackle is how to render the ...
-4
votes
0answers
22 views
script - loads with four out of the six divs then stops
I have 6 divs, everything is working well in the first 4 divs, in the sixth the modal box stops working and so does the video player. Any ideas?
<div id="container" align="center">
<div ...
0
votes
0answers
29 views
How to resize & move css divisions at same time?
I have a division in which i'll be having dynamic numbers of colorful blocks(that too divisions) at various instances. On clicking the box, i want them to expand & cover whole screen. the problem ...
0
votes
0answers
27 views
Highlighting state specific colors using for loop
So I created a map in using the following :
http://newsignature.github.io/us-map/
When I saw it said I could create heat maps for state specific styles I wasn't sure how to use the for loop on a JSON ...
0
votes
4answers
50 views
How to change color of the selected text dynamically on click of button?
I am using the following code to change the color of text but it is not working.. Can anyone help me with this? the soloution in javascript or jquery anything is fine..
var pinktext = ...
0
votes
0answers
7 views
Google Maps autosearch result filter
I use Google map auto search functionality.
var options = {types: ['(regions)']};
var autocomplete = new google.maps.places.Autocomplete(field, options);
I would like to know how can I filter the ...
0
votes
1answer
23 views
querySelectorAll for selector “not” does not work on IE 8
On IE 8, this script produces error:
var ygakandiuppercase = document.querySelectorAll('input[type=text]:not(.noupper)');
But if I remove "not" clause like this:
var ygakandiuppercase = ...
0
votes
1answer
7 views
Touch on video using swipe js not working with iphone
i using swipe for slider on my website.
when there is a item is video tag or object youtube in slider, can't touch on this item with iphone.
how to fix it?
Sorry for my english!
0
votes
0answers
7 views
How to make a graph based on data that is used by other graphs in java script?
I want to make a graph based on websockets. There is a web page which has dynamic graphs and I want to use the data that is read by these graphs.
I found some data in developer tools -> Network -> ...
0
votes
0answers
12 views
Mongodb push to array but keep the array with a max of 3 items
Is there an easy way to push to an array in mongodb such that the array has no more than 3 items. If there are 3 items the push should throw out the first item in the array. I'm looking for a safe way ...
0
votes
0answers
14 views
Allowing links from user's input - safety
I want to link what starts with http(s):// in user's input.
$ui = htmlspecialchars($ui, ENT_QUOTES);
$ui = preg_replace("/(https?\:\/\/[a-zA-Z0-9\_\+\@\&\-\#\/\%\?\=\~\|\!\:\,\.\;\(\)]+)/",
...
0
votes
1answer
27 views
How to solve “cannot call method 'down' of undefined” error?
my coding is basically pop up a option box to user when they click buy now for option product(example:choose color).
When I loaded this js, it show:
Uncaught TypeError: Cannot call method 'down' of ...
0
votes
4answers
34 views
getElementID, can someone tell me why this doesn't work?
i'm trying to learn JavaScript.. and I'm trying to follow examples.. and I can't get this getElementById to work properly... why is it saying Null in the alert box instead of the actual paragraph?
...
0
votes
0answers
79 views
Function is not completely executed
I have this function that causes the other functions to be skipped
I was just wondering what's wrong?
function sToLeftDiagonal(){
alert("sToLeftDiagonal");
var x, y;
var dCtr = 0;
var ...
1
vote
1answer
30 views
Why do Ruby and Javascript bitwise operators yield different results with same operands?
For example:
256 >> -4 # => 4096 (Ruby)
256 >> -4 # => 0 (Javascript)
Any tips/pointers are appreciated.
0
votes
3answers
51 views
NaN in Javascript showing up when using a text input field
I am trying to use a simple function of javascript that was intended to be used with a SELECT dropdown with single digits, but now I need to use it for when visitors type in a value with decimal ...
0
votes
1answer
17 views
facebook app share in the wall
first i just want to thank you you always helping me i learnt the best programming from you.
Anyway i coded a script with php well it is very simple the concept of it people answer some questions and ...
-2
votes
2answers
52 views
Where can I find a comprehensive list of any “magic” or “special” JavaScript syntax? [closed]
To clarify what I'm looking for, if I were asking this question about ruby, I'd be looking for things like HERE DOC syntax, various things the '*' and '&' operators can do, '_' as an empty ...
0
votes
0answers
30 views
MongoDb : How to insert additional object into object collection?
I have a document "owner" that can have "n" number of camps and camps have "instructors" and instructors have "classes". Earlier I tried accomplishing this with nested arrays (see link to my post ...
0
votes
1answer
20 views
Showing a modal When onclick method is called of <a>
i am using a salesforce platofrm.in which i have access to only onclick function of a button .i have to launch a modal like this code
<!-- Button to trigger modal -->
<a href="#myModal" ...
0
votes
1answer
15 views
Targeting an Iframe using javascript with php inside with GET method
Im a complete newbie in being a php developer so please forgive me if im too dumb xD
Im have a link that will need to send a specific value for a variable using onclick, but the thing is, i used the ...
1
vote
2answers
44 views
Undefined vs. defined window property in JavaScript
What is the difference between the following two statements (in the context of the global window)?
(function() { return a; } )(); // ReferenceError: a is not defined
(function(a) { return a; } )(); ...
0
votes
0answers
27 views
It is possible to add browse button to ASP web application w/o access to code behind?
I hope I'm phrasing all of this correctly - my web experience has been 99% with PHP and other...shall we say...transparent methods of coding. :-)
I'm doing some tests with an ASP web application ...
0
votes
1answer
30 views
How to find all lines that is not matching group of regex
According to this post, I tried to use ^.*(?!http).*$ to find all lines that is not containing the string http, but no luck.
TEXT:
"NetworkError: 404 Not Found - ...
0
votes
1answer
10 views
Origin http://localhost is not allowed by Access-Control-Allow-Origin with xui.js
hi i want to get a json file with xhr in xui and my code is this :
function getRequest()
{
x$().xhr('http://localhost:8080/DummyServer/login/request/',
{
callback: function()
...
0
votes
3answers
34 views
Javascript/Jquery-How to check if a function returns any value at all?
Is there a way to check if a function returns ANY value at all.
So for example:
if(loop(value) --returns a value--) {
//do something
}
function loop(param) {
if (param == 'string') {
...
0
votes
2answers
19 views
Chrome executeScript function not working
So I have an extension I'm writing and I'm trying to execute a script when the user clicks on the pageAction icon. When the icon is clicked, the method calls chrome.tabs.executeScript(...). The ...
0
votes
3answers
25 views
Looking for ECMAScript parser for ,net
I would like to build a tool to auto-document JavaScript script files.
I am looking for a .Net component that will parse ECMAScript 5.0 scripts such that I can enumerate every method, determine ...
0
votes
0answers
25 views
Dynamically adding iframe in IE7
So I have a script that imports another script which dynamically adds a div and then an iframe to the page. For example:
initial page:
<script type="text/javascript">
...
-1
votes
1answer
51 views
calculate differences between two time in minutes
How to calculate differences between two time eg(server time=04:30 pm and <p id="orderTime">02:30 pm</p>) and return it in minutes such as 90 minutes using jquery and javascript. The ...
0
votes
1answer
16 views
Building a minimal twitter analytics tool
Facebook provides very clear analytics of the page.
I want to build something on the similar lines on twitter.
Javascript(d3.js) can be used to draw charts and python can help me pull the data.
...
0
votes
0answers
8 views
Retrieve information from a Chrome extension
I am creating an extension for Chrome but I need to solve a "problem" and would like your help.
I have the following code:
var myExt = "a"
console.log("before");
ext = ...
3
votes
1answer
15 views
Hebrew unicode range not working in a Javascript RegEx?
I am trying to detect Hebrew characters using a regular expression. From what I have read, this is any character in the Unicode range 0x0590-0x05ff.
However, the following doesn't work:
// ...
0
votes
1answer
17 views
How to add “Disabled” attribute to options in Ember.Select
I have a Ember.Select view, how would i add/bind a disabled attribute to the option tag (NOT the entire select box).
ie, i would love to accomplish the following result.
<select>
...
0
votes
1answer
17 views
Is it possible to find out what request sended in Chrome Inspecter?
I want to find out what request, such as XMLHttpRequest, called in javascript? Is there anyway to find out? In Chrome Inspecter or inject some codes to find with chrome extensions?
Thanks!
0
votes
6answers
84 views
“||” operator is not working when assigning value to a variable
What is wrong with this code?
var sha = 6;
var secondParameter = dan || sha;
alert(secondParameter);
I tried it with many browsers. No alert.
If I add var dan like this:
var sha = 6;
var dan = 5;
...