JavaScript is a dynamic, object-based language commonly used for client-side scripting in web browsers. Recently, server side JavaScript frameworks have also emerged. JavaScript runs on nearly every operating system and  in almost every mainstream web browser.

Share tech news, updates, or what's on your mind.

Sign up to Post

H team i worked with DataTable its a tabular structure i wan to do the  same thing with div only how can i implement it .
Starting with Angular 5
LVL 13
Starting with Angular 5

Learn the essential features and functions of the popular JavaScript framework for building mobile, desktop and web applications.

I am getting an error when I run my node app using sequelize - 'Unknown column \'general_comments\' in \'field list\''. However, as seen below, I have a model with the column....general_comments.  Please see the error log below and the model code for compressor

Server started on port 5000
Executing (default): SELECT 1+1 AS result
Connection has been established successfully.
Executing (default): SELECT `compressor_house_id`, `equipment_area`, `equipment_type`, `photo_image`, `manufacturer`, `model_number`, `serial_number`, `service`, `capacity`, `severity`, `general_comments`, `createdAt`, `updatedAt` FROM `compressor_houses` AS `compressor_house`;
{ SequelizeDatabaseError: Unknown column 'general_comments' in 'field list'
    at Query.formatError (C:\Users\Chrystelle\Omar Martin\Dropbox\web design\hurricane_dorian\node_modules\sequelize\lib\dialects\mysql\query.js:244:16)
    at Query.handler [as onResult] (C:\Users\Chrystelle\Omar Martin\Dropbox\web design\hurricane_dorian\node_modules\sequelize\lib\dialects\mysql\query.js:51:23)
    at Query.execute (C:\Users\Chrystelle\Omar Martin\Dropbox\web design\hurricane_dorian\node_modules\mysql2\lib\commands\command.js:30:14)
    at Connection.handlePacket (C:\Users\Chrystelle\Omar Martin\Dropbox\web design\hurricane_dorian\node_modules\mysql2\lib\connection.js:408:32)
    at PacketParser.Connection.packetParser.p [as onPacket] (C:\Users\Chrystelle\Omar …
For the below code in React :

Does (city,key) is the input or output parameter for the function findAirport ?
What does "then(jsonData => {this.setState({ [key]: jsonData.Places[0].PlaceId });" mean ?
Does the code inside { } is the body of the function ?
What does .then mean ?
Can I omit 'this' for "this.findAirport" ?
Where does setState function defined ?


   this.findAirport = (city, key) => {
      fetch(""+city, {
        method: "GET",
        headers: {
          "X-Mashape-Key": process.env.REACT_APP_MASHAPE_API_KEY,
          "X-Mashape-Host": ""
      }).then(response => {
        return response.json();
      }, error =>  {
      }).then(jsonData => {
        this.setState({ [key]: jsonData.Places[0].PlaceId });
        if (this.state.toairport.length > 0 && this.state.fromairport.length > 0){

i have a user control uc_DocumentDate that contains a textbox ex:txt_Date
and inside the user control  i am doing the below $('#<%=txt_date.ClientID %>').change(function () {}
where inside i am filling hiddenfield hdn_1.value = "test"

Now, i have a web form where i am dragging and dropping the user control inside
and i am doing the below
try {
                var m_uc_DocumentDate = document.getElementById("<%=uc_DocumentDate.FindControl("txt_Date").ClientID%>");
                var m_uc_DocumentDate_ToSql = document.getElementById("<%=uc_DocumentDate.FindControl("hdn_1").ClientID%>");
                $("#" +"change", function () {
            } catch (e) {


Open in new window


after debugging the case i found that on change of thh form is fired before on change of thh user control
howcan i make the onchange of the user control  before on change of teh user control inside teh form
By the time this code comes to the createItem method at the bottom of this screenshot the FirstName variable is blank.  How can I make it take what I have put in the txtFirstName textbox?
I'm trying to update a Sharepoint online list column from a textbox without using a Framework.

public render(): void {
    this.domElement.innerHTML = `
      <div class="${ styles.financeSysAcc }">
        <div class="${ styles.container }">
          <div class="${ styles.row }">
            <div class="${ styles.column }">
              <span class="${ styles.title }">Finance System Access Request Form</span>

              <table style="width:100%;">
                    <td>First Name:</td>
                    <td><input name="txtFirstName" type="text" /></td>
                    <td>Last Name:</td>
                    <td><input id="txtLastName" type="text" /></td>
                  <td><input id="Submit1" type="submit" value="Insert" onclick="_addBooking('AlistairTest');"/></td>
              <p class="${ styles.description }">Name: ${escape(}</p>  
              <div class="ms-Grid-row ms-bgColor-themeDark ms-fontColor-white ${styles.row}">  
                <div class="ms-Grid-col ms-u-lg10 ms-u-xl8 ms-u-xlPush2 ms-u-lgPush1">  

Open in new window


The following page demos a simple API call and displays the result:

I'd like to produce the same output on my own html page. How could I start?

Many thanks
I am looking to build an alternative to Zapier "zap" using a digital ocean droplet. Can anybody recommend a technology? The first thing that comes to mind is Node.js or PHP. Zapier is great, and we love it, however we are now being asked to processes files with up to 10,000 lines per file per month. This brings our zapier bill from @20 per month to $300. I would like to have a webHook online with custom URL. (

our zap is very simple:
* push FirstName, LastName, Email to a webook
* add the user to a mail chimp list
* add the user to a wordPress memberPress subscription
* send the user a custom welcome email from an office 365 account

There are a few reasons it might make sense to build our own integration tool:
1 ) if we are going to get 10,000 items to process every month or so, it it much nicer to just budget $50 per month for an AWS or Digital Ocean VM
2 ) During the memberpress user create, then add to the correct subscription, the smallest time pause that Zapier allows is 1 minute. When we are processing 10K of new users, this can extend out for quite some time. It might be easier to have the ability to control down to a 15 second wait time.
3 ) I am not sure how zapier runs each zap, but during the memberPress adds it might be nice to know they are all running in serial. I often wonder if zapier runs them in parallel. We frequently get DB timeout errors when the zaps are running.

What I am looking for is advice on the following:
Hello there!
Link to all products:

The Issue:
When you filter the site by "size", products with color variants that are SOLD OUT in that particular size still appear in the main grid instead of being hidden. This is due to an app that we are using to split the color variants from one product and present them on the main collection table.

Why It's Happening:
We've installed an app called "Variants on Collection Page" to split the colored variants from within an individual product page onto the main collection table, resulting in all our products being displayed with their respective color variants beside them. The main issue we are running into here is that the app doesn't work well with the filter app we're using, Power Tools Suite, because the filter creates collections based on tags that it has auto-tagged. An example of how the issue manifests:

Let's say we have a product called "Roma Shoe" with three color variations, gray, brown and black. They have a full size run from Size 5 to 10, but size 7 in gray is SOLD OUT. Since "Roma Shoe" has two other colors, brown and black, that still have size 7 available, the main product (that encompasses all three colors) in the back end is still going to be tagged by Power Tools Suite "size-7" to be put into the auto-collection "7". There is no way for the filter app or the variant splitting app to know that size 7 in gray is SOLD OUT because the filtered results are …
How to add // @flow to that ButtonLarge.test.js file so it will pass the test
currently I will get error after running yarn run flow:

Cannot assign <QuestionMark /> to props.icon because property icon is missing in object literal [1].

when I set icon: undefined in beforeEach, it clears the error but I don't know if it's valid solution  

beforeEach(() => {
    props = {
      onClick: jest.fn(),
      text: 'Save as a template',
      icon: undefined

Open in new window

Any hints?
I am getting an error in the console from an anchor tag.  I'm not sure how to fix it.
jquery-2.2.4.min.js?ver=null:2 Uncaught Error: Syntax error, unrecognized expression:

I'm not sure how to fix a jQuery error on an anchor tag.
OWASP: Threats Fundamentals
LVL 13
OWASP: Threats Fundamentals

Learn the top ten threats that are present in modern web-application development and how to protect your business from them.

Dropzone.js on bootstrap page with collapsible left sidebar shows the "Browse" link when the nav bar is collapsed. Inspecting it shows the HTML inserted by the dropzone js, but the positions of the element have changed and the hidden attribute of the element is ignored. This places the element under my collapsed nav bar. See attached. Otherwise, all works as expected.
Here is the HTML from the inspect:

<a class="file-input-wrapper btn dz-hidden-input">Browse<input type="file" multiple="multiple" class="dz-hidden-input" style="visibility: hidden; position: absolute; top: 21px; left: 59px; height: 0px; width: 0px;"></a>
<input type="file" multiple="multiple" class="dz-hidden-input" style="visibility: hidden; position: absolute; top: 21px; left: 59px; height: 0px; width: 0px;">

Open in new window

I use vector map. and I hope to capture the selected US state (california) on click when California area is clicked, and then pop up a modal. so I can take the selected state (California) and develop some api call.

Do you know how to do that? Just capture the state and get modal up.
with the following js codes,

using this url works: http://localhost:3835/Home/Index 

but this one does not works: http://localhost:3835/Home/Index?f=1.

it just return nothing. do you know how to fix it?

function GetSegmentPositionName(position) {
    var pathArray = window.location.pathname.split('/');
    var segment = pathArray[position];
    return segment;

Open in new window

hi i am looking for onkeypress javascript code for <input> just want mask phone like (xxx)xxx-xxxx
I have a thirdparty rest api and angular js frontend project that I inherited.

data is in json, and the code iterates over the collection and displays it.
as I don't have control over the api and what it returns , I want to hide certain items in the collections.

what are my options in angularjs?
popover moves slightly to the right when the first time user clicks popover button twice.

steps to reproduce:
1. Use link
2. click on popOver button, a popover appears, drag this to any location, let's say the end of the line.
3. click again popover button, the popover will disappear.
4. click on the popover button again, this time popover will appear but slightly to the right where the user left it earlier.

Expected Behaviour: It should appear exactly the same location where left earlier.
Hi Experts,

How do I figure out what is the right name/id for this?

alert('span[id^="cbParamVirtual1_61c45887756bd5LabelCell"]').val); //bf

Open in new window

See attached error.

I've a file like below and i want to read it and assign to my combobox.

! Script 1:
 script.menuitem ($item_1) = 'Measurements...'                   ! name of combobox item entry
 script.file     ($item_1) = './results/measurements.sjs'        ! name of script file to be used
 script.menuitem ($item_2) = 'Post...'                   ! name of combobox item entry
 script.file     ($item_2) = './results/post.sjs'        ! name of script file to be used

Open in new window

The combobox will use as display text for item1 "Measurements..." and when user select it i'll know user sleecting the script's link to ./results/measurements.sjs and this is going for other items.

Any help would be grateful.

Hi All,
I need to do a document image template matching with the original document image. Is it possible using Artificial Intelligence or Machine Learning?

Basically, we will get a filled document image as an input. We need to match it with the already existing documents image based on template matching and return the identification of the matched document image.

Please help.

Thanks In advance.

Kavita Choudhary.
Learn SQL Server Core 2016
LVL 13
Learn SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

I have a legacy AngularJS site that I'm maintaining.

All that I need to do is redirect  to

Notice the site is using the hash location strategy.

I would like to use the rewrite module in IIS.

I'll have to test the solution on our staging site that uses IIS version 7.5.

On our production servers I have IIS version 10.0.14393.0

Can someone let me know what the rewrite rules should look like
I am ready to put my .js designs onto the table. I have been getting most of what I want working, except for game-object flicking.

I'd like ( on a sideways turned phone/ device) for the player to be able to flick <div> objects towards the middle of the screen, in a natural-feel frame-time controlled environment.

How should I proceed?

I'm trying to use Twilio to create a ringless voicemail with Twilio.

I'm using PHP to write this in ideally.

I'm open to other options as well.

Can anyone tell me how I would go about doing this?
It is working fine and it stopped working now. When i run the javascript code from vscode,

i get the error

Attribute 'program' does not exist ('/node_modules/protractor/bin/protractor').

My package.json file is below

      "type": "node",
      "request": "launch",
      "name": "ptor Spec",
      "program": "${env:REPO_NEWTON}/node_modules/protractor/bin/protractor",
      "args": [

Open in new window

I am using the latest datatables with Keys and Editor which is working great except for somewhat slugglish performance when moving around using keys. We are using an inline editor allowing the user to tab through the fields and specify values. The problem is the users are quick on the keyboard and it takes the interface a second or so to focus and render the editor for the cell. The delay is long enough for keyboard entries to be lost. Are there any common tricks I can look for to improve this speed?

My datatable is:

mainTable = $('#OrderDetails').DataTable({
data: data.OrderDetails,
dom: 'Blfrtip',
lengthMenu: [[25, 50, 100, -1], [25, 50, 100, "All"]],
deferRender: true,
fixedHeader: true,
rowId: 'OrderDetailId',
keys: {
columns: '.SizeField, .EditableLineField'
buttons: [
extend: 'excel'
, text: 'Export'
, className: 'btn btn-circle btn-lg blue'
, exportOptions: {
columns: ':visible'

I have a simple javascript code that works fine in IE 11, but of course no one uses that anymore.  It does not operate at all in Chrome, Safari, Edge, etc.  No errors, just doesn't do what it is supposed to.  I've attached the section of the file, as well as the "inc" file that performs the task.  Any help on what needs to be changed for later browsers would be much appreciated!

Here is the code that calls the function:
<table width="95%" cellpadding="3" cellspacing="3" border="0" align="center" class="blueborder">                                   
                                        <td colspan="3" class="subcontent">
                                            <div class="subcontent" style="line-height:40px;">Use the following "Browse" button to select and upload multiple images.</div>
                                            <input id="fileInput" name="fileInput" type="file"/>
                                            <div style="padding-top:10px;"><a href="javascript:$j('#fileInput').uploadifyUpload();">Upload Files</a> | <a href="javascript:$j('#fileInput').uploadifyClearQueue();">Clear Queue</a></div>
                                            <div id="fileQueue" style="padding-bottom:5px;"></div>  
                                            <div class="greycontent" style="line-height:25px;">[Note: Select multiple files using Shift or CTRL key]</div>     

Open in new window







JavaScript is a dynamic, object-based language commonly used for client-side scripting in web browsers. Recently, server side JavaScript frameworks have also emerged. JavaScript runs on nearly every operating system and  in almost every mainstream web browser.