JavaScript

122K

Solutions

42K

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

How do I determine if a script is a manifest script?  I need to list them all for a specific web app. I can obviously filter ".json" files  but how will I know if it is a manifest script?

Thanks!
0
Big Business Goals? Which KPIs Will Help You
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

Hi,

I have a requirement.I need to write in HTML/ JavaScript / CSS to embed a  chat BOT widget (web chat window) on an ASP.NET website with collapsible window. Initially an icon should be shown  and on click of that icon it should play an audio sound and then display that collapsible pop up .
(i.e.,The popup widget  should stick to the bottom of the browser and popup /collapse feature.)
An help will be highly appreciated.
0
I am using DropZone but would like to send another form field to my controller.  I don't think I can add the form field inside the Form - other than as a hidden field.
I have my View as:

    @{
        ViewBag.menu = false;
        ViewBag.Title = "Upload New ARC Request";
        ViewBag.maxFiles = 1;
    }

<div class="col-xs-10">

        <div class="row">
            <div class="col-xs-6">
                @Html.Label("Title:")
                @Html.TextBox("NewTitle", null, new
           {
               @class = "form-control",
               @placeholder = "Enter Title",
               @id = "NewTitle"
           })
            </div>
          </div>

            <div class="row">
                @using (Html.BeginForm("Upload", "Upload", FormMethod.Post, new
                {
                    @class = "dropzone dz-clickable",
                    @enctype = "multipart/form-data",
                    @id = "documentDropzone"
                }))
                {
                   @Html.Hidden("title", t)
                        <div class="dz-message">
                            Drop files here or click to upload.
                        </div>
                }
            </div>
            <script type="text/javascript">
                Dropzone.options["documentDropzone"] = {
                    maxFilesize: 10000,
                    acceptedFiles: "application/pdf"
                };
            </script>
        </div>

</div>

<script 

Open in new window

0
I have a javascript button at https://www.theherbsplace.com/rebate-program/ it is found at the bottom of the page. The button state is being carried over to every customer.  I need to make sure if someone doesn't want membership that the message doesn't show up that they do.

This is a WooCommerce site.

Here is the code

<script>
document.getElementById("order_comments").innerHTML = "I want membership";
</script>

Open in new window


<p><a class="button exclusive biz-op-button" title="I Want Membership!" href="#" data-register="true">Get My Membership</a></p>
<p class="form-row notes" id="order_comments" data-priority="">
    <label for="order_comments" class="">Order notes&nbsp;<span class="optional">(optional)</span></label>
    <span class="woocommerce-input-wrapper">
        <textarea name="order_comments" class="input-text " id="order_comments" placeholder="Notes about your order, e.g. special notes for delivery." rows="2" cols="5"></textarea>
    </span>
</p>

Open in new window

0
Dynamics 365 8.2.3,

We are running Dynamics 365 8.2  and having an issue with editable grids.  When using the editable grid, XRM.Page is not supported so code to summarize grid data and update a field on the parent form only works when the form is Refreshed, not when the value is edited “in-line”.

I can make this work, but I need to to capture the grid column value, when changed on the “onchange” event.

According to the documentation I have found, the code examples seem to utilize Dynamics 365.  I’m not sure the Javascript we have supports the examples I have seeing online…specifically the “getFormContext”

Please review the code below and let me know what I need to change.

Thanks

function pvalue(context) { 
    alert("here");  //this works
 
    var estimatedvalue = context.getFormContext().data.entity  // this does not
    var val = estimatedvalue.attribute.getByName("ring_estimatedvolume");
    alert(val.getValue()); 
}
 

Open in new window

0
Hi, Please see http://dev.magickitchen.com/weight-loss-meal-delivery/  - I don't think you'll need to log in.

I have an earlier question, https://www.experts-exchange.com/questions/29132073/White-space-on-scroll.html  in which I got a lot of help, but now I have a javascript related question that sparing from that.

Scott said to remove the headroom plugin after fixing the code errors. I made the change on the last line, and now the errors are gone (thanks, Scott!).

But now when I try to remove the headroom section, I get a syntax error. I am trying to remove this exact code:
      function Headroom (elem, options) {
        options = extend(options, Headroom.options);

        this.lastKnownScrollY = 0;
        this.elem             = elem;
        this.tolerance        = normalizeTolerance(options.tolerance);
        this.classes          = options.classes;
        this.offset           = options.offset;
        this.scroller         = options.scroller;
        this.initialised      = false;
        this.onPin            = options.onPin;
        this.onUnpin          = options.onUnpin;
        this.onTop            = options.onTop;
        this.onNotTop         = options.onNotTop;
        this.onBottom         = options.onBottom;
        this.onNotBottom      = options.onNotBottom;
      }
      Headroom.prototype = {
        constructor : Headroom,

        /**
         * Initialises the widget
         */
        init : function() {
          

Open in new window

0
Hi

In  my ASP.net web app I am using the following Javascript code to redirect users on mobile devices to another page.
On a different page I want to hide a Menu bar called "Menu1" and show a hyperlink called "Link1"

How would I do that?

<head runat="server">

    <script type="text/javascript">
    <!--
    if (screen.width <= 699) {
    document.location = "http://steel1.azurewebsites.net/Mobile_OffersByMe";
    }
    //-->
    </script> 

</head>

Open in new window

1
how to show java-script alerts and HTML dialog input in Xamarin crosswalk ????
its working by default when using crosswalk in android studio ..
1
I have an aspx web form that I want to open with the browser maximized.  To do so I have found this code in a search here at EE.  The post says "Just insert it in your aspx code".  Can anyone tell me where exactly to insert it?

Here is the javascript to insert:
<script language="JavaScript1.2"> 
top.window.moveTo(0,0); 
if (document.all) 
   { top.window.resizeTo(screen.availWidth,screen.availHeight); } 
else if 
   (document.layers || document.getElementById) 
   { 
   if 
    (top.window.outerHeight < screen.availHeight || top.window.outerWidth < screen.availWidth)
     { top.window.outerHeight = top.screen.availHeight; 
       top.window.outerWidth = top.screen.availWidth; } 
   } 
</script>

Open in new window

Here is my code for default.aspx:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="default.aspx.cs" Inherits="LineStatus.LineStatus" %>

<!DOCTYPE html>
<link href="Stylesheet1.css" rel="stylesheet" type="text/css" />

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>"Production Line Status"</title>
    <meta http-equiv="refresh" content="30">
</head>
<body>
    <form id="form1" runat="server">
       
            <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" Height="100%" Width="100%" Font-Size="X-Large" Font-Names="Calibri" BackColor="#CCCCCC" BorderColor="#999999" BorderStyle="Solid" BorderWidth="3px" CellPadding="2" ForeColor="Black" HorizontalAlign="Center" OnRowCreated="GridView1_RowCreated" 

Open in new window

0
I have this code in a loop ie: each delete button and csrf token shows as many times as there are database records:

<div class="buttons-to-right">
<a href="edit-listing/<%= products._id %>" class="button gray edit"><i class="sl sl-icon-note"></i> Edit</a>
<input type="hidden" name="_csrf" value="<%= csrfToken %>">
<a href="#" class="button gray delete" data-id="<%= products._id %>"><i class="sl sl-icon-close"></i> Delete</a>
</div>

Open in new window


I want to get the value of the csrf token that is in the same vicinity as the button that was clicked.

document.body.addEventListener("click", e => {
  if (!e.target.matches(".delete")) return;
  e.preventDefault();

  const deleteBtn = e.target;
  const csrf = document.querySelector("[name=_csrf").value;
  const productId = deleteBtn.dataset.id;

  console.log(csrf);

});

Open in new window


I tried using 'closest' but that was an epic fail.

 
 const deleteBtn = e.target;
  const csrf = deleteBtn.closest("[name=_csrf]").value;

Open in new window

1
Build an E-Commerce Site with Angular 5
LVL 12
Build an E-Commerce Site with Angular 5

Learn how to build an E-Commerce site with Angular 5, a JavaScript framework used by developers to build web, desktop, and mobile applications.

I'd like to remove quotation marks from the "username" field before it is submitted.
Can this be done with JavaScript ?
0
What are your advices and technologies to design a Web portal UI for our customers to be robust, reliable, light and modern?
Note: The web portal will integrate with another Web applictions.
0
I am trying out some Javascript and i cant get this code to work quite the way i want.

I am comparinga password and confirmpassword field. oninput, if the passwords dont match i want to display the Passwords do not match element. Oninput when the passwords DO match i want to hide that input and display the Passwords match element.

So far i can get the Passwords do not match element to work properly, but my fields (even when pw are the same) wont show Passwords Match element.

What am i doing wrong?

<!DOCTYPE html>
<html>
<body>

<input type="password" id="password" oninput="myFunction()">
<input type="password" id="confirmPassword" >
<p id="alert" style="display:none;"> Passwords do not match <p>
<p  id="success" style="display:none;"> Passwords Match <p>



<script>
function myFunction() {

if(document.getElementById("password").value != document.getElementById("confirmPassword").value){

document.getElementById("alert").style.display = "block";
document.getElementById("success").style.display = "none";

} else {
document.getElementById("alert").style.display = "none";
document.getElementById("success").style.display = "block";

}
 
}  




</script>

</body>
</html>

Open in new window

0
https://www.magickitchen.com/weight-loss-meal-delivery/  when I scroll, there's a white space. Another question here showed me it's from the js code that hides the top navigation on scroll. What I need to do is find out what div gives that white background, and change the color.

See earlier question:  https://www.experts-exchange.com/questions/29132073/White-space-on-scroll.html?headerLink=workspace_answered_questions

The top navigation used to be white, so this wasn't a problem. It's still not a huge issue, but I'd like to color that white. Thanks.
0
I have this piece of code where i am trying to validate the jquery based Date of Birth Validation.

is there any JS function which also checks the full date if it falls in a leap year or not, i am trying this but it does seems to be working

function isValidDate(s) {
  var bits = s.split('/');
  var d = new Date(bits[2] + '/' + bits[1] + '/' + bits[0]);
  return !!(d && (d.getMonth() + 1) == bits[1] && d.getDate() == Number(bits[0]));
}

Open in new window


date i tested is: 02/29/1920 - it is giving false (edited)

testing it like this:

    function init_inputOnKeyUp(){
        $('select[name="day"],select[name="year"]').off('change');
        $('select[name="month"],select[name="day"],select[name="year"]').on('change', function(e) {
        if (type == 'select') {
            var newdate = $('select[name="month"]').val() + '/' + $('select[name="day"]').val() + '/' + $('select[name="year"]').val();
                        var results = isValidDate(newdate.toString());
                        console.log(results);
                        console.log(newdate.toString());
        }
        });
}

Open in new window


problem i can't use any extra library like moment.js

the error is it is always giving me false when i try to validate with a full date

i am not sure at this point, if the error is happening on leap year or onchange issue
1
getDeals();

    setTimeout(function () {
        timelineController();
    }, 300);

    createDefaultProps();
    loadSocialData();
  
    
    loadLeadData();

    loadActData();
    getJr();
    getJrTimeline();

Open in new window


here is my list of functions which each has a ajax function, how do i tell these functions to wait until ajax is complete ? and run in order
1
Hi Web Experts,

I’ve found a menu on W3Schools which would probably suit my website quite well, because it’s lite (and has very little JavaScript and no external links except font-awesome which I can easily workaround), is 2 level, simple and responsive (using a hamburger menu).  Here’s the info on it, and here’s the demo.

It seems to work quite well except for some minor problems (some of which I might be able to work around myself), but one problem I don’t know how to fix is:

If I add more “Dropdown” menus (which I’ve done here), then on my phone click “Dropdown 1”, then change my mind and click “Dropdown 2”, it opens “Dropdown 2” so I can see the items under it, but within a second it automatically takes the 3rd option under the “Dropdown 2” menu (“Link 2C”).  (I guess this is related to the fact that “Link 2C” appears in the same position that “Dropdown 2” was before I clicked “Dropdown 2”.)  This problem happens on my phone (Samsung J7) in both browsers (Chrome and Samsung “Internet”), and I've also noticed it on a Samsung J5 and old Samsung Gio.  (No such problem occurs if I click "Dropdown 2" then "Dropdown 1".)

Is anyone able to offer a fix for this, please?

Thanks.
tel2
2
Hello


I have a line that take time to execute and wile that it execute the browser is stuck (it can be stuck for 40 sec)

the line is  -  xactiveXobject.theStream.LoadFromFile(remote_computer/folderx/foldery)

 xactiveXobject.theStream =  new ActiveXObject("ADODB.stream");
  xactiveXobject.theStream.LoadFromFile(remote_computer/folderx/foldery)  -- take long time

any way to excute this line to chank ?

it is run on IE only with ActiveXObject
0
Dear Experts,
I have found a code on web that rotate an images, which is perfect.
However, this code works perfectly fine with only one image, but when I want to use it with more than one image it only works for the first image,
I want to rotate an image when I click it.

How can I do that to work with all images on my page?
Thank you

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<style>
#image {
    transform-origin: top left; /* IE 10+, Firefox, etc. */
    -webkit-transform-origin: top left; /* Chrome */
    -ms-transform-origin: top left; /* IE 9 */
}
#image.rotate90 {
    transform: rotate(90deg) translateY(-100%);
    -webkit-transform: rotate(90deg) translateY(-100%);
    -ms-transform: rotate(90deg) translateY(-100%);
}
#image.rotate180 {
    transform: rotate(180deg) translate(-100%,-100%);
    -webkit-transform: rotate(180deg) translate(-100%,-100%);
    -ms-transform: rotate(180deg) translateX(-100%,-100%);
}
#image.rotate270 {
    transform: rotate(270deg) translateX(-100%);
    -webkit-transform: rotate(270deg) translateX(-100%);
    -ms-transform: rotate(270deg) translateX(-100%);
}
</style>

</head>

<body>

<a href=# id="button"><img src="..../img/logo-tr7.fw.png" id="image" />
</a>
<br>

<a href=# id="button">
<img src="https://..../img/logo-tr6.fw.png" id="image" />
</a>

<script>
var angle = 0, img = document.getElementById('image');
document.getElementById('button').onclick = function() {
    angle = (angle+90)%360;
    img.className

Open in new window

1
Exploring SharePoint 2016
LVL 12
Exploring SharePoint 2016

Explore SharePoint 2016, the web-based, collaborative platform that integrates with Microsoft Office to provide intranets, secure document management, and collaboration so you can develop your online and offline capabilities.

Quick overview of JSON tokens

please provide me a few sentences to explain JSON tokens. I have worked with JSON on various full stack positions, and wonder how JSON tokens fit in.

Thanks
0
I'm trying to get a client side javascript reference to a RadWindow opened by a call to radopen().

Example:

function OpenAWin() {
    var oWnd = radopen(null, "myWindow", width, height);
}

How do I get a reference to "myWindow" later on the client side? I do not want a global variable as I may need to open several windows on the same browser.
And I can't use a server-side instantiation of the window either.

Thanks!

-David
1
Hi, please see https://www.magickitchen.com/weight-loss-meal-delivery/.  On scroll in desktop view, there's a white space that appears between the photo and the header, and I can't figure out where it comes from or how to fix it. Can anyone help? Thanks!! (I see it on two browsers, my desktop resolution is 1600x900)

Untitled-1.jpg
0
I have a javascript button at https://www.theherbsplace.com/rebate-program/ it is found at the bottom of the page.

Here is the code
<script>
document.getElementById("order_comments").innerHTML = "I want membership";
</script>

Open in new window


<p><a class="button exclusive biz-op-button" title="I Want Membership!" href="#" data-register="true">Get My Membership</a></p>
<p class="form-row notes" id="order_comments" data-priority="">
    <label for="order_comments" class="">Order notes&nbsp;<span class="optional">(optional)</span></label>
    <span class="woocommerce-input-wrapper">
        <textarea name="order_comments" class="input-text " id="order_comments" placeholder="Notes about your order, e.g. special notes for delivery." rows="2" cols="5"></textarea>
    </span>
</p>

Open in new window


The button works fine but I need it to change colors and text on click.  This is so the customer will know their request has been logged.

I am not very strong in javascript.  I see on the net some examples but I don't know enough to fold them into what I already have working.

Thanks,
0
I am trying to think of a way to save a JSON object onto the a web page without displaying it to the end user.  The purpose would be to save the object until another function calls it like a button.  This would be used to push the value to a POST action.  Would it be better to save the entire JSON object or a string id value?
0
I have a side project that I want to rewrite on my own time. I want to use ASP.Net Core and Angular as front end.

I'm reading about the latest version of Angular https://angular.io/guide/releases

Is it Angular 7 but the stable version is 6?
0

JavaScript

122K

Solutions

42K

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.