Tagged Questions
JavaScript (not to be confused with Java) is a dynamically-typed language commonly used for client-side scripting. Use this tag for questions regarding ECMAScript and its various dialects/implementations (excluding ActionScript). Unless a tag for a framework/library is also included, a pure ...
0
votes
0answers
9 views
Mimicking this results from form element outside of form
I have this form:
<form name="dateChooser" id="dateChooser">
<select name="chooseMonth" id="calChooseMonth">...</select>
<select name="chooseYear" ...
0
votes
0answers
11 views
How can I toggle those two divs while clicking on an inside div?
I have:
HTML CODE:
<div id="katy"> <a href="javascript:void(0);" id="a"> Button 1 </a> </div>
<div id="perry"> <a href="javascript:void(0);" style="display:none;" ...
0
votes
1answer
5 views
How could I create different interceptors for different API-endpoints?
I have 2 Services in AngularJS that for 2 different API-endpoints, they are based on $http service (or simply they are wrappers of $http).
Now I have task to create errorHandling for each of the ...
1
vote
0answers
7 views
Disable Google Maps scrolling on mobile layout
I am trying to a way to disable scrolling google maps on mobile layouts.
function initMap(){
var isDraggable = $(document).width() > 480 ? true : false; // If document (your website) is wider ...
0
votes
0answers
6 views
jQuery Waypoints not working with with Bootstrap3 classes?
I'm having problems having the waypoints.js plugin work correctly with bootstrap3.
Here is a page with the absolute default barebone bootstrap boilerplate and the navbar code pasted into it. I just ...
0
votes
0answers
5 views
How to make reusable directive+controller $watch a passed-in scope parameter?
In my parent template I have:
<widget-available the-foobar="pageCtrl.foobar" vertical="true"></widget-available>
Then in my widget-available controller I have
...
0
votes
0answers
11 views
How to deal with JavaScript Error: “e is null” when try to click on browser pop-up in Firefox
When using the alert methods of selenium-webdriver, I encountered the JavaScript Error: "e is null"
Code:
browser = Watir::Browser.new :firefox
browser.alert.ok; sleep 5
Error:
...
1
vote
0answers
8 views
pass a variable in url to resource callback function in AngularJS
app.factory('Greeter', ['$resource',function($resource){
return $resource(
'http://123.com/processor.php?'+'myvar=1066',
{callback: 'JSON_CALLBACK'},
{
query: ...
0
votes
3answers
34 views
JavaScript, Whats the difference between defining variables with $ and without? [duplicate]
Is there any difference between defining variables:
var p_tr1 = $('<tr> </tr>')
$p_tr = $('<tr></tr>')
i'm using netbeans, and variables have different highlighting.
I ...
0
votes
1answer
6 views
Facebook JavaScript SDK sometimes works other times not
I am using on my website Facebook like using this code:
$(document).ready(function() {
var fbBtnLike = '(function(d, s, id) {var js, fjs = d.getElementsByTagName(s)[0];if (d.getElementById(id)) ...
0
votes
0answers
30 views
Why doesn't this JavaScript function calculate correctly when the site is first loaded, but works fine afterwards?
I am working on a site that generates notation for a random musical rhythm based on some user-selected parameters. It does this by using an ajax call, which returns a random set of <img> ...
0
votes
0answers
11 views
protecting my distributed javascript (third party javascript)
1)my distributed script is placed on sites without any id references (in element attributes)
2)once the script is fired via a site:
the HTTP Origin Header is detected and verified on my server ...
0
votes
1answer
11 views
Using $scope.$watch when using `this` scope in controller
I have a controller in my Angular app:
(function (angular) {
function MyController() {
this.name = 'Dave';
// I want to have code like this:
/*
...
0
votes
0answers
8 views
Developing android/ipad application in Cognos
As part of a project for a large organization, we are looking to develop a tablet based application. The application needs to be visual, interactive and user friendly. The organization already uses ...
-2
votes
2answers
15 views
Why must “text(x)” and not “.text = x” be used in jQuery?
Assigning like this
$('#myelement').text = 'some text';
has no effect visually. Is the above ignored by jQuery?
Instead, it should be
$('#myelement').text('some text');
0
votes
2answers
10 views
Detect keycode ALT+L via Javascript
I try to detect if a user presses F12 or ALT + L.
document.onkeydown = function (event) {
event = (event || window.event);
if (event.keyCode == 123 || (event.keyCode == 18 && ...
0
votes
0answers
4 views
Using type of property as second information in ECMASCRIPT languages
I saw this in some php scripts around the web and start to use it myself, but never in JavaScript, or ActionScript. Now I'm working object oriented with classes and this strategy seams to be good for ...
0
votes
0answers
4 views
Multiple image cycle scripts on one page?
I have the following code:
<IMG SRC="http://2.bp.blogspot.com/-8ChQ3SBxYOY/U9bSBt4bcMI/AAAAAAAARDE/zLDJ1kP903A/s1600/1.png" name="VCRImage" BORDER=0>
<IMG ...
0
votes
0answers
3 views
Problems with ng-repeat and ajax-loaded content in directive
I'm creating some directive that wraps up jCarousel plugin. But content for it loading dynamically via ajax.
So here are examples of my code:
Calling directive in HTML:
<div class="jcarousel" ...
0
votes
2answers
22 views
Filter a part of String
I have an array and its data shows on a table. Live Code
Filter by date or by name are working well.
I write some more code to show "No Data Found" if users enter a name, which is not on the ...
0
votes
0answers
9 views
Submit variables into a loop of ajax calls [duplicate]
I use this loop to read some urls to read their modified time:
for (var e in arr) {
nodename=arr[e].hostname;
node_json="/nodes/"+nodename;
html +='<a href="'+node_json+'" ...
0
votes
0answers
33 views
Div wrap makes links wrapped in <ul> unclickable
I can't figure this thing out for the life of me! I know the html is a little messy but it works for what I wanted to do. The problem here is that I can't click the links once they're wrapped in the ...
0
votes
0answers
30 views
Jquery .data() method not working when getting html attributes
For some reason, the jquery .data() method is only working when the data is set using jquery. Attempting to retrieve data attributes set in the html results in a return value of null or undefined. ...
1
vote
0answers
13 views
How costly are trips to server for SPAs
I'm building an SPA which will run on your average tablet, so resources aren't too extensive.
I'm thinking about initially retrieving all the data needed for the application and storing it in ...
0
votes
2answers
20 views
How to randomly iterate through an array once, and then repeatedly iterate in that order
This is my array: arr = [0, 1, 2, 3, 4, 5] I want to randomly iterate through it the first time and then iterate through it in the same (random) order each time after that. How would I do it? The only ...
0
votes
0answers
2 views
IEWebdriver: Cannot click on option element. Executing JavaScript click function returned an unexpected error
I am testing web page with large number of forms.
The page has main form and couple of sub-forms.
Specific sub-forms are rendered only when specific values are selected in main form.
Lately, the ...
0
votes
0answers
4 views
Three.js create texture from image file
I'm having some trouble creating a texture from an image file in Three.js. I have a function to create a mesh that looks like this:
var image = document.createElement('img');
image.src = ...
0
votes
0answers
13 views
MVC4: change li/a tag text on click event of Url.Action
In the Razor view there is following html:
`<li id="myli"><a href="@Url.Action(MyAction, new { Id = ViewBag.Id })" >TEST</a></li>
I can Not change it in any way. Some kind ...
0
votes
0answers
15 views
Slider is not showing images
I am working on slider of a website. And i am not quite good in jQuery. The strange matter is slider is not showing images. I used bx slider and basic jQuery slider. But I get same result from both ...
0
votes
1answer
49 views
Javascript loop refuses to do a function
My javascript changes the innerHTML, but refuses to add the delay to it. My goal is to make a menu that moves the list items right after each other, but this only works for the first two list items. I ...
1
vote
2answers
28 views
JavaScript variable doesn't work in Laravel
All the pages in my website has the same header. I implemented that like this:
extends('layouts.main')
Now in some pages, I need to send a successful message and in other pages not. I implemented ...
0
votes
0answers
18 views
Executing javascript in an an AJAX response - Codeigniter
I am using Codigniter to redo a website. I have the following controller code:
public function get_topics()
{
$topic = ...
0
votes
0answers
7 views
Confused about :selected elements in safari
I have a <select> menu where I need to select the options dynamically, so I have written some jquery: $("option[data-route='apps/rc']").attr("selected",true)
This works fine in Chrome, but in ...
0
votes
0answers
20 views
Send Email through Javascript/HTML using user client
I know this question has been somewhat answered already in that using client-side scripting does not send emails, but please bear with me. I would like to have a 'send email' form on my website. The ...
0
votes
0answers
4 views
Karma + AngularJS + Kendo: Kendo-grid testing is not working
My project is using AngularJS + Kendo-UI. And I'm trying to integrate Karma into the existing project. I can test directives and components that I build is rendered in the test. But when I try to load ...
-2
votes
4answers
48 views
onClick add input field
I want to add a transparent input text field in the centre of DIV #mainC each time the button is clicked.
JsFiddle
I tried doing this with jquery but did not succeed.
0
votes
0answers
6 views
Can't create a mesh from a loaded Three.js object
I used clara.io to export a model with four textures on it in the ThreeJS Object format. It results in a .json file. I am trying to load it and have it display correctly. If I do the following(taken ...
0
votes
3answers
38 views
Render HTML after each iteration in loop
I am trying to slowly increase the font size of text on a web page. The code I have in place does work, however the new HTML/CSS does not render after each iteration of the loop and will just display ...
0
votes
1answer
14 views
How to make a globally accessible variable?
How can I make a globally accessible variable in nightwatch.js? I'm using a variable to store a customized url (dependent on which store is loaded in our online product), but I need it to be ...
0
votes
1answer
4 views
Set ReactJS state asynchronously
If you do an asynchronous action that updates the state in componentWillMount (like the docs say), but the component is unmounted (the user navigates away) before that async call is complete, you end ...
0
votes
3answers
33 views
RegEx first name validation
I have a question:
I want to do a validation for the first and the last name with RegEx.
I want to do it with only Hebrew and English without numbers.
Someone can help me to do that code?
0
votes
3answers
26 views
Array not storing values in for loop
Im parsing a json object and storing the values I want in an array, I then push each array into a second array inside the for loop to create an array where each element in a2 is a1.
Im already ...
0
votes
0answers
3 views
Meteor.js Twitter login when running on the Codio editor “page not available”
I'm using the online IDE called Codio which comes with internal hosting.
Each Codio project gets assigned a url and a port, for my Meteor project it was http://deliver-milk.codio.io:3000
I tried ...
0
votes
1answer
9 views
Having Issue deleting and adding data to html table using dataTable
I have a html table in my page field with data from a database.
My Action column is a delete button when i try to press the delete button on that specific row that row should be deleted on the ...
1
vote
2answers
18 views
Reload a page inside iframe
I have an iframe and I want to reload the currently displayed page on button press.
HTML:
<iframe id="webView"></iframe>
JS:
function reloadPage()
{
var webView = ...
0
votes
2answers
17 views
Create a record in Rails from AngularJS
I have an Angular application that sends http requests to a rails server. I'd like to make a request to create a record (in the table SavedQueries).
The Angular app is actually making a very simple ...
-1
votes
1answer
15 views
Nan from consol.log
When looping through my array objects in the console I get nan
why is this? Also what can I do to get the actual values?
lineArr.forEach(function(arrayItem) {
var x = arrayItem.prop1 + 2;
...
1
vote
1answer
8 views
Meteor.js template echo not working
I'm following a Meteor tutorial, following it step by step and I have run into two issues:
1) when I call the {{> message}} between {{#each messages}} and {{/each}}, my "check if it works" doesn't ...
0
votes
1answer
20 views
Script works fine in any WebKit based browser but doesn't in Firefox
I have a script in (using wordpress) header.php which looks like this:
window.addEventListener("DOMContentLoaded", function(event) {
fixedMenu.init("header-container", 0);
...
0
votes
0answers
5 views
How do I override Mailchimp error response messages in an embedded form?
I've run into a user experience problem with an embedded Mailchimp form displaying in a colorbox using Drupal 7 that I am beating my head up against a wall trying to fix.
Here's what I've got:
Upon ...