[Webinar] Streamline your web hosting managementRegister Today

x

JavaScript

120K

Solutions

41K

Contributors

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

I want to use one Angular js for the front end and C# asp.net MVC and sql server for the back end.

how do you integrate or star development.

do you build your angular application first ? how to hook up the angular js and C# controller methods to post the data?  is there any best practices or how do developers do this in real applications?
0
Receive 1:1 tech help
LVL 11
Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

Not sure where to begin, I am using a CSV to Html table template by Derek Eder https://github.com/derekeder/csv-to-html-table.
Chris Stanyon pointed out that it appears to be using the DataTable plugin on a previous related question of mine
Is there a way to format the table so a if column 5 has CANCELED anywhere in it it makes the entire row black with white text
I don't have any experience in javascript as is apparent from my previous question so any help would be greatly appreciated.
0
Not sure where to begin, I am using a CSV to Html table template by Derek Eder https://github.com/derekeder/csv-to-html-table.
I'm using it to display a list of events that have happened, I would like to see if there is a way to make the default sort for the java app be reverse chronological order instead of chronological order. I know there are multiple sort functions, however since I am automatically refreshing every 10 seconds and it would be handy to have the results sorted the way I would like automatically.
I don't have any experience in java so any help would be greatly appreciated.
0
Finding really hard to hide the Cancel button, when the inner html gets displayed. How can I force the outer div to get the refresh? The last div section is not getting refreshed.

HTML

<div class="panel-group step-one" [class.hidden]= "(!isOtherOneTimePaymentSelected  &&( oneTimePaymentMethod?.id || show.oneTimePayment.stepTwo || (hasCreditCardMethod && hasBankPaymentMethod)))">
                <div class="panel" [class.expanded]="expand.oneTimePayment.card" [class.hidden]="expand.oneTimePayment.bank">
                    <div class="panel-heading" (click)="expandOneTimePayment('card')">
                        <h4 class="panel-title">Credit Card</h4>
                    </div>
                    <div class="panel-body">
                        <div class="panel-inner">
                            <add-card (saved)="createdOneTimePaymentMethod($event)"
                                      [system]="selectedSystem"
                                      [isCancelable]="true"
                                      (canceled)="cancelExpand($event, 'card')"
                                      [paymentMethod]="oneTimePaymentMethod">
                            </add-card>
                        </div>
                    </div>
                </div>
                <hr class="panel-break visible-xs" />
                <div class="panel" [class.expanded]="expand.oneTimePayment.bank" [class.hidden]="expand.oneTimePayment.card">
                    <div 

Open in new window

0
I guess the question is:  Is there an HTML / Javascript solution to read/parse the contents of a text file and populate the web page accordingly

Here is what I'm trying to accomplish...

I want to read a text file & that has the following:

ReportName1;D:\REPORT1\URL\here
ReportName2;D:\REPORT2\URL\here
ReportName3;D:\REPORT3\URL\here

and so on

I want a simple HTML page to look like this:

ReportName1
ReportName2
ReportName3


I think I could do something  like this:

<a href="%%var_link1%%">%%Var_ReportName1%%</a><br />

<a href="%%var_link2%%"> %%Var_ReportName2%% </a><br />

<a href="%%var_link3%%"> %%Var_ReportName3%% </a>

  • Where
  • var_link
  • is the path name from the text file
  • Where ReportName is equal to the actual report name
0
I want to start learning Angular JS. Looking at the tutorials there are several different ways to set up the environment, which uses gulp, bower and many more
what is the simplest way to  get started with, to start learning this framework.
0
Hi Experts,

I've been using a JS export code that allows me to take data that is being passed from my dashboard and exported as a new excel file (xls).  The export function allows you to save the name of the file, and sheet name.  All this is great.  What I am needing help on is how can we programmatically save the exported file to a pre determined folder (network drive)?  I am not familiar with JavaScript so any assistance would be greatly appreciated.  

This is a request that will give executives the ability to click on a report used for certifying data and have to only hit "Certify" and the csv is placed in a network drive (folder) and the executives will never have to do anything other than hit the certify button. The problem with my code now is that it saves on the local machine as a default.

https://github.com/jmaister/excellentexport

Thanks!  
Attached
excellentexport.js
0
On Click of Refresh button in IE with https protocol , IE is opening a POSTDATA warning,
How do I reload a page without a POSTDATA warning in Javascript with JavaServer Faces?
0
I'm trying to figure out how I can scrap/detect if the phrase "We regret we cannot open the account you requested." is on the page using CSS Selector and/or Javascript (jQuery is ok if that is the only option but want to avoid it if possible?). Below is an excerpt from the mark-up.
<!-- current page: offers --> 
        <div class="main">
     <h3>Eligibility Results</h3><p>Thank you for your online application for an account at Bank of the West.  We regret we cannot open the account you requested.<br/>
If you would like to discuss this application with Bank of the West, please contact us at:</p>

Open in new window


Thanks!
0
Hi

I need to do some regular auto login with this website: https://max.eq-3.de/login.jsp The html below is not working for this website maybe because of the .jsp? Maybe I missed something, I tried some different scripts even PHP with cURL, but i never managed to paste any text in to the form fields?

<HTML>
<HEAD>
<TITLE>
Login</TITLE>
<script>
<!--
function login() {
    document.maxRemoteLogin.action="https://max.eq-3.de/login.jsp";
    document.maxRemoteLogin.submit();
}
//-->
</script>
</HEAD>
<BODY onLoad="login()">
<FORM NAME="maxRemoteLogin" METHOD="POST">
<INPUT TYPE="hidden" NAME="user" VALUE="xxx">
<INPUT TYPE="hidden" NAME="passwd" VALUE="yyy">
</FORM>
</BODY>
</HTML>

Open in new window

0
The new generation of project management tools
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

execFile(script, (error1, stdout1, stderr1) => {
                        if (error1 || stderr1) {
                            logger.error(script);
                            logger.error("+++++++++++" + error1  );
                            reject(false);
                        }
                        if (stdout1) {
                            logger.info(script);
                            resolve(true);
                        }
                    });

Open in new window


when the script is log/getdata.bat
'log'is not recognized as an internal or external command, Pls suggest
0
Need to show or hide a DIV with Javascript based off of PHP string variable. Basically, I have a DIV with a lot of information and do not want to show it on the page, if the information supplier with the PHP script has not values. I am testing the value by setting a php variable and want to use javascript to see if there is a string in the php variable and if so, show the div. If the string is empty or blank, then hide the DIV.
0
I am using free jqgrid.  I have a row attribute based on a cell value that works fine when the grid is loaded, but when I do a reload, the attribute doesn't work.  any suggestions?
0
I'm working on a web site with a search box that shows the search results in an overlay with the original page unavailable in the background. I need to change the focus to the first link in the search results box so that visually impaired people using an OCR will hear or feel the brail of the first search result. (Currently the OCR continues to read from the page behind.)
The search uses www.googleapis.com/customsearch as the search engine.
After the search completes, one of the <div> tags gets an extra class: The <div> goes from :
<div class="gsc-results-wrapper-overlay" >
to
<div class="gsc-results-wrapper-overlay gsc-results-wrapper-visible">
That gsc-results-wrapper-visible class gets added to the div tag.
The page is created with SharePoint and so I don't want to mess with that unless there is no other choice. I want to do everything on the client side if possible.
My question is, how can I capture that div element when the search finishes. What DOM event would I react to? More generally, how can I discover these DOM events myself using developer tools?
I thought about something like this:
document.getElementsByClassName("gsc-results-wrapper-overlay").addEventListener("eventX", displayDate);
But even then I don't know what "eventX" would be.
The site is here:
https://www.dcccd.edu/pages/default.aspx
0
I have a script that paginates pages in a table, which works fine. I also have a dropdown to select how many records to show in the table. Although this works, if I select say 20 records the pagination does not update to reflect the change.

When the table is run, the default records to show is 8 whih makes 9 pages. But if I select 20 in the drop down it still says 9 and if I go to page 9 it is obviously empty. I am also wondering if it is possible to have the script appear in both before and after the table. the reson for this is if a user gets to the bottom of say 100 records, then I would like this feature so they don't have to go all the way back to the top.

I would appreciate any help as my javascript is not 100%. Many thanks

php

<?php
    echo "<table class='paginated' cellspacing='0' cellpadding='0'>";
    echo "<div class='pager'></div>";
    echo "<thead><tr><th style='width: 5%;'>#</th><th>Service</th><th>Activity</th><th>Dept</th><th>Company</th><th>Address</th><th>User</th><th>Item</th><th>Date</th><th style='width: 19%;'>Action</th></tr></thead>";

    while($row = mysqli_fetch_array($result)){

    $id = $row['id'];
    $service = $row['service'];
    $activity = $row['activity'];
    $dept = $row['department'];
    $company = $row['company'];
    $address = $row['address'];
    $user = $row['user'];
    $box = $row['item'];
    $date = $row['date'];
    $date = date('d-m-Y h:i:s', strtotime($date));
    $edit = "<button type='button' class='btn

Open in new window

0
hi
i have end dates that are stored in the database as: February 15, 2018 10:9:29

one is created from edge browser, one from chrome and one from FF. all of them are stored with the same string.
but all these browsers interpret the date differently. i attach the console images:
edge interpret all of them.
chrome and FF see the one that was created with edge as Invalid Date
also, FF interpret the date differently than chrome.

the aim is to delete the record if the date and time has past. so i have this:
let today = new Date();
console.log('today: ',today);
          data.forEach((data) => {

            if( new Date(data.enddate) < today  ){
              //delete automatically hangouts which are past due date
              console.log('in the past: ',new Date(data.enddate));
              this.deleteSelfieChallange(data.$key,data,false);
            }else{
              console.log('not in the past: ',new Date(data.enddate));
            }

          })

Open in new window


the issue is that the deletion obviously does not work with the Invald date.

any idea?
from chromefrom edgefrom FF
0
Hi, Having an issue with setting div visible/hidden.
 On selection change of an option in a nested div, make the current <div> hidden and other <div> visible.
I am having an issue with this.  Whatever changes you do it's not hiding the other div.
The following is the plunker:

https://plnkr.co/edit/bhjWdCtnStGtr3G74ngN?p=preview

In the above Plunker, if I select an option, then it should hide the Production Type drop-down and show only Credit Card and Bank Account.
0
Hi I am trying to get my games to output the current time in seconds that the game is running for as a score for the player in the canvas but I keep getting an undefined var instead of the number?

Does anyone have any idea whats wrong with my code??


Thanks, See code below.

HTML5 Canvas
JS
var Game = {
    canvas : undefined,
    ctx : undefined,
    backgroundImage : undefined,
    backgroundMusic :undefined,
    soundImage: undefined,
    soundImagePosition : { x : 750, y : 10 },
    vy : 0,
    rocket : undefined,
    rocketPosition : { x : 350, y : 400 },
    dxSpeed: 7,
	dySpeed: 3,
	keyboard : { keyDown : -1 },
	keys : {
    A: 65,     B: 66,      C: 67,      D: 68,       E: 69,      F: 70,
    G: 71,     H: 72,      I: 73,      J: 74,       K: 75,      L: 76,
    M: 77,     N: 78,      O: 79,      P: 80,       Q: 81,      R: 82,
    S: 83,     T: 84,      U: 85,      V: 86,       W: 87,      X: 88,
    Y: 89,     Z: 90, 	   LA:37,      UA:38, 	    RA:39,      DA:40,
 }
};

function handleKeyDown(evt) {
    Game.keyboard.keyDown = evt.keyCode;
}

function handleKeyUp(evt) {
    Game.keyboard.keyDown = -1;
}

Game.start = function () {
    
    document.onkeydown = handleKeyDown;
    document.onkeyup = handleKeyUp;

    Game.canvas = document.getElementById("myCanvas");
    Game.ctx = Game.canvas.getContext("2d");
  

    Game.backgroundMusic = new Audio();
    Game.backgroundMusic.src = "assets/audio/start.mp3";
    

Open in new window

0
0
Never miss a deadline with monday.com
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

0
Hi There,

I have a mongodb aggregate query in PHP that is throwing an error and I can't see what I've missed in the syntax.

Versions are
mongodb =  3.6
PHP  = 7.1
mongo PHP driver = 1.3.1-1


 The query in mongo shell works and looks like this:

db.products.aggregate(
	[
		{
			$match: {
			    download_Date : {'$gte' : 20180205 }
			}},
		{
			$sort: {
			download_Date: 1 }
		},
		{
			$group: {
			 _id: "$cw_product_id", batch: { $last : "$download_Date" }
	        }},
	]

Open in new window


My code in PHP fails and  looks like

$command = new MongoDB\Driver\Command([
    'aggregate' => 'products',
    'pipeline' => [    
        ['$match' =>  [ 'download_Date' => ['$gte' => $batch ]]],
        ['$sort'  => [  
            'download_Date' => 1
        ]],
    ['$group' => [ 
        '_id' => [ '$cw_product_id', 'batch' => ['$last' => '$download_Date'] ],
        ]],   
    ],
        'allowDiskUse' => true, 
        'cursor' => new stdClass, 
    ]);

Open in new window


The error I receive when running the php script is

           
PHP Fatal error:  Uncaught MongoDB\Driver\Exception\RuntimeException: Unrecognized expression '$last'

Open in new window

I've pulled it apart and put it back together so many times, a fresh pair of eyes is needed to spot the obvious.  

Thanks in advance,

Rick
0
I have a text field where users enter whole numbers.  What I want to do is to automically add a decimal point and two zeros to the end of the number (ex: 123.00) when it is manually entered.  For some reason, it is too much work for users to simply add .00 manually.
0
Hi Experts, is it possible to download the file from outside the web directory? My web folder root directory is located at "C:\FolderWeb", while I want to download the file which is located at C:\Vb6\StopSkyWin.bat I'm using this <a href="C:\Vb6\StopSkyWin.bat" download>Visual basic 6</a> but it doesn't work. Any help, please!
0
Hi Guys,
I am returning JSON data from the server with ajax. When the data return it come like:
"['Id','Name','Phone','MailStop','Active','Out','UserName','RowTimeStamp','UserId','EmailAddress','FirstName','LastName','SSN','StatusStatus',]"

The issue I have here is the quotation in the beginning and the end. I do I remove these quotations. I have to take this data above and make it like a string.
I was trying many things like stringify, replace.
please see my code example:

function GetData() {
        var data;
        $.ajax({
            type: "GET",
            url: '/Tables/Getpaging',
            dataType: "json",
            async: false,
            //data: {},
            success: function (resp) {
                data = resp
            }
        });
        return data;
    }

    var Dataobj = GetData().BindData;

function GetHeaders() {
        var headerName = "";
        for (var i = 0; i < Dataobj.length; i++) {
            if (i == 0) {
                for (var key in Dataobj[i]) {
                    headerName += "'" + key + "',";
                }
            } else {
                break;
            }
        }
        debugger;       
        var arr = "[" + headerName + "]";
        return arr;
    }
    

Open in new window

0
Hi experts, I have found an inconsistency with the codes below getting the date using javascript. There are times in the day that the Date will go to advance sometimes months or years. I could not trace the problem because there is no specific time when it occurs. I wish experts could help me solving this problem. Thank you!

HTML

<!doctype html>
<html lang="en">
<body onload="GetDate()">
<div style="height:25px;">
 Date:&nbsp;<input type="Date" id="menuDate" class="posDate" readonly/>
 <button onclick="return mnuDate()">Date</button> 
 <input type="text" id="tDate">
</div>

<script>
function GetDate()
{
  var myDate = new Date();
  var myDateStr = myDate.getFullYear() + "-" + myDate.getMonth() + "-" + myDate.getDate();
  var nowDate = myDate.getFullYear() + "-" + myDate.getMonth() + "-" + myDate.getDate();
  var PosDate = myDate.getMonth() + "/" + myDate.getDate() + "/" + myDate.getFullYear();
  
  document.getElementById("menuDate").valueAsNumber = new Date(myDate.getFullYear(), myDate.getMonth(), myDate.getDate(), 12);

}

function mnuDate()
{
  var iDate = document.getElementById('menuDate').value;
  iDate = ((convertDate(iDate))); 
  document.getElementById('tDate').value = iDate;
}

function convertDate(arg)/*cd17*/
{
	var a=Date.parse(arg);
	var b=new Date(a);
	var day=b.getDate();
	if(day<=9){
	  day='0'+day;
	}
	var month=b.getMonth()+1;
	if(month<=9){
	  month='0'+month;
	}
	var year=b.getFullYear();
	var stringDate=month+'/'+day+'/'+year;
	return 

Open in new window

0

JavaScript

120K

Solutions

41K

Contributors

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.

Vendor Experts

Gil FeldmanMonday Learn more about Monday