0
votes
2answers
20 views

onchange event repeats calculation after editing the same field

I have a javascript as below: function calculateBill(id,price) { var t = document.getElementById('total').value; var qty = document.getElementById('qty_'+id).value; var total = qty * price; ...
1
vote
1answer
63 views

Best way to concatenate strings in javascript?

In JavaScript, I have a loop that has many iterations, and in each iteration, I am creating a huge string with many += operators. Is there a more efficient way to create a string? I was thinking about ...
0
votes
3answers
47 views

Javascript: cannot override concatenation

Using the following code I want to move a line with id='seekline' by var1 (less than .1 in most cases), but I run into trouble adding var1 and j. The plus sign concatenates instead of adding. I have ...
0
votes
1answer
78 views

Concatenate & minify directory of JS files into one JS file with Guard and UglifyJS

I have a folder of JS plugins that i would like to concatenate and minify into a plugins.js file using Guard and UglifyJS Here's what I have in my Guardfile so far guard 'uglify', :input => ...
0
votes
2answers
19 views

Building Large Number from JSON

At the moment I receive JSON with objects. Each object has 4 strings which contain 3 digits. I need to construct a large number from those digits. For example if the digits are "111", "222", "333", ...
1
vote
1answer
79 views

Changing the data in URL strings - Using API for database requests

Using an API I am creating a forum using Javascript. When a user clicks on the thread title on the index.html page they are taken to a page called thread.html on here I am using an API call to ...
0
votes
4answers
60 views

Jquery concatenting very simple counter with a Variable [closed]

Following another question, I have a working script to create dynamic form fields : FIDDLE I thought I will figure out the rest, but I do not understand why when I try to assign a new name and ID ...
1
vote
3answers
64 views

How to concatenate variable in string in javascript

I am using this var abc = jQuery('#pl_hid_addon_name').val(); alert(abc); var atLeastOneIsChecked = jQuery('input[name="addon-"'+abc+']:checked').length ; alert(atLeastOneIsChecked); But it not ...
0
votes
3answers
63 views

String building with Javascript document.write

I am trying to write a div element from javascript. I want the line written as follows, using document.write(): <div class="Square15px" onmouseover="changeColor('boxid')"></div> I call ...
1
vote
2answers
45 views

String concatenation not working, throwing error

I am storying a dynamic string in a variable and then resuing that string later in the code. It is throwing an error, "Uncaught SyntaxError: Unexpected token +" var template_url = "<?php ...
0
votes
1answer
87 views

HTML Form Action URL - add JS variable to URL

I have a JS variable which holds the value of a PHP variable. <script> var xxxx = "<?= $v2 ?>"; </script> I also have a form which points to superman.php <form ...
0
votes
1answer
50 views

Javascript How to contatenate two array elements if certain condition meets

I'm working on a javascript function can solve basic algebra. (ex. x +5 +x +2 = 11). I split the string where the equals sign is. Everything is printed into the console to test. > [x +5 +x +2] ...
1
vote
1answer
189 views

Combine JSON files with grunt-contrib-concat

I'm looking for the best way to combine json files in a folder. With HTML, CSS and JavaScript this is pretty easy since you don't need a separator or only a single ;. However, with JSON, we need ...
0
votes
1answer
103 views

grunt-concat separator option?

how to specify a separator in this scenario: I'm concatenating my files with grunt-concat this way: concat: { options: { banner: '<%= banner %>', separator: "" }, dist: { ...
1
vote
0answers
109 views

compile RequireJS to remove AMD dependency

I'm using RequireJS to manage my dependencies in development, but at production I would like to remove all dependencies on an AMD loader. It looks like the RequireJS optimizer creates a file that ...

1 2 3 4 5 7
15 30 50 per page