Go Premium for a chance to win a PS4. Enter to Win

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

The following chart has a filter applied, keyword "bingo"

https://fusiontables.google.com/DataSource?docid=1Gk2Gpw70hvXqjDoXVcAu8G_7xTwIv4jrhsHiEkL7#chartnew:id=4

Unfortunately the HTML publishing feature does not seem to work (the filter gets removed)

Is there any workaround i can use to publish the filtered version of the chart (apart from creating a new table with the filtered data)?

I want to be able to show the chart on it's own.

This question is as aside from https://www.experts-exchange.com/questions/29069155/Creating-a-dynamic-query-for-Google-Fusion-Tables.html

Thanks
0
Free Tool: Port Scanner
LVL 11
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

If you look at the Orography tab in the attached file there is a graph. The blue line represents a hill or ridge. The dots represent the position of a scaffold on the hill. On the left is the upwind side and there is an orange line. If the scaffold is above this line then it is affected by the terrain and a set of equations need to be checked. I want to shade above the line. On the right is the downwind side. I want to shade below the grey line down to blue. I can introduce dummy nodes to place a node on the blue line directly under the grey line node. I can do the same the other side at 0,900. I cannot find how to shade these areas?
graph.xlsx
0
Hello Experts,

I have coped and pasted the following javascript into my application, see image, but I keep on getting the error message shown in the image.
module.exports = function (context, req) {
    context.log('JavaScript HTTP trigger function processed a request.');
    if (req.body && req.body.name && req.body.id && req.body.age && req.body.address){

    context.res = {
        //status: 200, /* Defaults to 200 */
        body: "Data is saved for user " + (req.body.name) +" !!"
    };

     context.bindings.outputDocument = JSON.stringify({
         id: req.body.id,
         name: req.body.name,
         age: req.body.age,
         address: req.body.address
     });
}
else {
    context.res = {
        status: 400,
        body: "Please pass all user details"
    };
}
context.done();

};

Open in new window

Can someone let me know where I'm going wrong?

Thanks

Carlton
0
hi,

The following fusion tables chart uses an sql query to populate the chart:

http://enex.net/autorecon/fusion/GC_network.html

How can i edit the query to filter for say keyword "bingo" ? Ideally as a variable so as a follow-up question/project I can link this to a input search box and start developing the page.

<iframe width="1000" height="600" scrolling="no" frameborder="no" 

Open in new window

0
Hi,
To the prompt, after having pressed Password button below. I expect the password strength to be shown, exactly after having input two password (but before Submit button is pressed). What to adjust?
http://my-friend.co/UserMaintenance2/Default.aspx?userid=mc23&readonly=n
0
I have an app where I do a $.ajax and do a get call to an API, which returns a previously converted excel file (excel to base64); I need to re-convert this base64 data back into it's original form - i.e. into Excel file. I tried retracing the steps I took to convert the excel into base64, reversing some of them, but I'm not able to generate the original file. An excel file IS being generated, but it still has base64 data and therefore opens w/ errors and in a corrupted state. Has anyone else successfully done this?

Below is my code and fiddle link: (I didn't add the base64 json data (responseData) here since it's large, but it's on the fiddle)

var bindata = window.atob(responseData);
function DownloadExcel() {
  window.location.href = "data:application/vnd.ms-excel;base64, bindata"
}
var blob = new Blob([responseData], {type: 'application/vnd.ms-excel'});
if (window.navigator && window.navigator.msSaveBlob) {
    window.navigator.msSaveBlob(blob);
}
else {
    var objectUrl = URL.createObjectURL(blob);
    window.open(objectUrl);
}

Open in new window



Fiddle link: https://jsfiddle.net/damon_matt/2ofz6xrd/14/
0
Angular: 5.0.1 / Angular CLI: 1.5.0 / Node: 8.9.1 / npm: 5.5.1 / Os: win32 x64

I get the below error when executing "npm start" in the terminal/command prompt. Can anyone help me resolve this? I have spent a whole day trying to fix it with no luck.

Here is the scripts section of my package.json

"scripts": {
    "start": "webpack-dev-server --inline --progress --port 8080"
  },

Here is the error

0 info it worked if it ends with ok 1 verbose cli [ 'C:\Program Files\nodejs\node.exe', 1 verbose cli 'C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js', 1 verbose cli
'start' ] 2 info using npm@5.5.1 3 info using node@v8.9.1 4 verbose run-script [ 'prestart', 'start', 'poststart' ] 5 info lifecycle angular-io-example@1.0.0~prestart: angular-io-example@1.0.0 6 info lifecycle angular-io-example@1.0.0~start: angular-io-example@1.0.0 7 verbose lifecycle angular-io-example@1.0.0~start: unsafe-perm in lifecycle true 8 verbose lifecycle angular-io-example@1.0.0~start: PATH: C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin;C:\Users\cbonsu\Downloads\sample_pro\webpack\node_modules.bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\Git\cmd;C:\Program Files (x86)\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\130\DTS\Binn\;C:\Program Files\Microsoft SQL Server\130\DTS\Binn\;C:\Program …
0
I'm trying to set the secure property on a cookie using JS but I can't get it to work? We always use https . Not sure what I'm doing wrong?

document.cookie = cookieName+"="+botwGuid+"; path=/; domain=.mydomain.com; secure";
0
When I select the save button in tab 2 , the focus does not stay in tab 2 but instead it jumps back to tab 1.
Here's the code..
<div id="myTabs">
            <ul class="nav nav-tabs tabs" id="thistab" runat="server">

                <li class="tab-link current" data-tab="tab1" id="tab11" data-toggle="tab" title="Person" onclick="return setText('lblSelect',this.title);"><a href="#tab1">Person</a></li>

                <li class="tab-link" data-tab="tab-6" id="tab6" data-toggle="tab"><a href="#tab6" onclick="return setText('lblSelect',this.title);" runat="server" title="Employee">Information</a></li>
                <li class="tab-link" data-tab="tab-2" id="tab2" data-toggle="tab"><a href="#tab2" onclick="return setText('lblSelect',this.title);" title="Assignment">Assignment History</a></li>
                <li class="tab-link" data-tab="tab-3" id="tab3" data-toggle="tab"><a href="#tab3" onclick="return setText('lblSelect',this.title);" title="Issues">Issues</a>
                    <ul class="tabs show-on-hover" id="ulIssue">


                        <li class="tab-link" data-tab="tab-8" id="tabs-8"><a href="#tabs-8" title="New Issue" onclick="addlocation('RedIssue.aspx')">New Issue</a>

                        </li>


                    </ul>
                </li>
                <li class="tab-link" data-tab="tab-4" id="tab4" data-toggle="tab"><a href="#tab4" onclick="return setText('lblSelect',this.title);" title="PPC">PPC</a></li>
                <li 

Open in new window

0
Hi,

I have converted the code from frames to <div>
<div class="container">
      <div  id="frameName1"> </div>
 <div  id="frameName2"> </div>
  </div>

i have tree in div frameName1. i have different tabs in framename2 for adding and updating the nodes.   when submit is done on framename2, i want to refresh div framename1.

how to convert the below code for <div> tag?
<%
if (Request.Form["btnSubmit"] != null )
{
%>
       <script language="javascript" type="text/javascript">
              //Refresh the tree;
           parent.frameName1.location.href = "index.aspx"; 
       </script>
<%
}
%>

Open in new window

0
Concerto Cloud for Software Providers & ISVs
LVL 5
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Could anybody help?
In Visual Studio 2013
In a body of html page I put following code:
 
<script>

    var tdElm = document.getElementsByTagName('td');
       console.log(tdElm);
       console.log(tdElm[0].children);
       console.WriteLine(tdElm);

    </script>

Open in new window

and got a following error:

0x800a01b6 - JavaScript runtime error: Object doesn't support property or method 'WriteLine'

What sould I do to fix it?
0
when we use multiple xsl templates and apply them

<xsl:template match="/">
            <html>
                  <body>
                        <h1>order info:</h1>
                        <xsl:apply-templates></xsl:apply-templates>

what are the practical use cases and sample examples on using multiple xsl templates say converting one xml to other xml format or from xml to html

please advise
0
On change event of "select" element i want to use MainPage.php to reload an image.
I have next code, which is not  working;
js  code
function imageRefreshOnSelectChange(){        
$.ajax({
  type: 'POST',
  url:'/wp-content/themes/net/MainPage.php'
});
}

Open in new window

 

header.php
<body>
    <?php include_once("net/pageTop.php");?>
    <?php include_once("net/MainPage.php");?>
    <?php include_once("net/pageBottom.php");?>
</body>

Open in new window



MainPage.php
<?php
...............
............
 $users=..........;
?>
<div class="right" id="usersWindowID">
        <p><?php echo $users ?></p>              
    </div>

Open in new window



Is it possible to tell from the code i have provided what am i doing wrong?
0
In the html world what is difference between
<th> vs <td>

when we use each under <tr> of <table>
please advise
can i use one another interchangeably?
0
<form name="submit_form" action="./uploads/submit.inc.php" method="POST">
                  <div class="wrapper">
               <code id="ace-editorid" name="code_editor" contenteditable>
                     Your Code Here
               </code>
               <textarea name="newTextArea" id="newTextArea" style="display: none;"></textarea>
      </div>
          <script type="text/javascript">
                document.getElementById("ace-editorid").oninput = function() {
                  document.getElementById("newTextArea").innerHTML = document.getElementById("ace-editorid").innerHTML;
            }
          </script>
          <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
          <script src='http://cdnjs.cloudflare.com/ajax/libs/ace/1.1.3/ace.js'></script>
          <script  src="./css/script.js"></script>
          Type the Problem ID: <input type="text" name="probId">
          <input type="submit" name="b_code_submit" class="submit_query">
</form>

In this code what i want to do is that i'm taking code input from user in       `<code>` tag and copying it to the `<newTextArea>` tag, so that i can use it in my another php file using POST method, but when i'm doing it, i'm getting blank text.
0
Hi,
I am having default.aspx page. This page contains two iframes. Left iframe is having tree. clicking on parent or child nodes will open diferent pages in the right iframe. User can add or edit information using right iframe and it will reflect in the left iframe. making changes in the firames doesn't refresh the default.aspx.

Session Timeout 15 minutes.
Warning Popup appears at 13  minutes. clicking ok on dialog. user can continue to do the work till 2 more minutes and it will redirect to session timeout page.

Problem: Warning popup appears at 13 minutes. clicking ok on dialog. user is doing some activity and click submit on iframe2. This will reset the session timeout again back to 15 minutes. This part is not working.
If I refresh the default.aspx then session timeout is resetting, but refreshing the iframes not reset the session timeout. Please find my code and fix the issue. I am stuck in this issue.

[b]default.aspx[/b]
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="default.aspx.cs" Inherits="default" MasterPageFile="~/Masterpage.Master"%>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp"%>
 
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
 
    <div class="container">
      <iframe id="frameName1" src="index.aspx" frameborder="0" class="indexframe" ></iframe>       
      

Open in new window

0
I have 3 tabs. On tab # 2 I have two draggable items and one droppable. My two draggable items are "good" or "bad". On tab 3 I have a button and a textarea. Upon the click of the button it will determine if you feel good or bad. What I want to achieve is: when I am on tab #2 and I drag an item into the drop area, lets say I drag and drop the "good" item, I then tab over to tab # 3 and click the button which asks " how do you feel", since I dragged and dropped the "good", when I click the "how do you feel button" it will display "good" within the text area on tab #3. Likewise, if on tab 2 I drag and drop the BAD and then tab over to tab#3 and click the "how do you feel button" then it will display as "bad" inside the textarea. Please help!! Thank you.

HTML:

<div id="tabs-1">
        <h2>Sign Up</h2>
    <form id="myform">
    <br>
    <label for="first_name">First Name:</label><br>
    <input type="text" id="first_name" name="first_name" required> <span class="error" id="first_error"></span>
    <br>

    <br>
    <label for="last_name">Last Name:</label><br>
    <input type="text" id="last_name" name="last_name" required> <span class="error" id="last_error"></span>
    <br>

    <br>
    <label for="last_name">Start Date:</label><br>
    <input type="text" id="datepicker" name="datepicker" required> <span class="error" id="date_error"></span>
    <br>
    <br>
    <span class="error" id="all_error"></span>

         <p><input type="button" id="button" value="Creat

Open in new window

0
datatable table aligment is not coming correctly  in IE and MOzila  but working fine in Chrome i am sending two images  please check
<!DOCTYPE html>
<html lang="en">
<head>
  <title>Bootstrap Example</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css" rel="stylesheet">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
  <!-- ------------important-------------------- -->
  <link rel="stylesheet" type="text/css" media="screen" href="https://cdn.datatables.net/1.10.12/css/jquery.dataTables.min.css">
  


  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
  <script src="https://code.jquery.com/jquery-1.12.4.js"></script>
  <script src="https://cdn.datatables.net/1.10.16/js/jquery.dataTables.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
 

  <script type="text/javascript">
    $(document).ready(function() {
        resizeContent();
    $('#example').DataTable( {
        "spagingType": "list-box",
        "dom": '<"top"lfi<"clear">>rt<"bottom"><"clear">',
        "scrollX": true,
        "scrollY": true,
        "searching":false,
         "ordering": true,
         "fixedColumns": true
    });
     $( ".dataTables_info" ).insertBefore( $( ".dataTables_length" ) );
     

Open in new window

0
I'm using the fullcalendar and working great, but I want to give the user the option to goto two different url's when pressing the event on the calendar. Right now I have it going to the url listed, but I would like them to beable to choose a link for the description and maybe a link to go back where they created the event. I hope this makes sense. Again when viewing the calendar and you click on a event you might have a drop down that says Details and one that might say edit.

Thanks
0
Industry Leaders: We Want Your Opinion!
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Hi ,

I have added the following code to my website so that it redirects to a mobile version when viewing from a mobile, and works just fine, However I've got a button in the mobile version that will allow visitors to go to a desktop view in case they want to go back on their mobile device. How do I allow this.? or what shoukd I add to the button to allow this.

https://racingnsw-test.mystagingwebsite.com


<script type="text/javascript">
<!--
if (screen.width <= 699) {
document.location = "http://t.m.racingnsw.com.au/";
}
//-->
</script>

Open in new window



Also, I use the following URL https://racingnsw-test.mystagingwebsite.com/wp-json/wp/v2/posts fro a web service to fetch the articles to display in the mobile version. If I redirect to mobile, I believe I will get redirected to  http://t.m.racingnsw.com.au/ . how Can I force this specific URL to not redirect.
0
I have one project for drawing, this one developed by flash before.

It can upload image and draw some area ( like circle, rectangle ,,,,   )on it .  Also it can give the url link to this area and save to database. Later you can load this image which have areas and link on it.
Yes it has more function like enlarge, move...

Now the client want get rid of the flash.

Anyone know how to code this using HTML5 and JavaScript. I know html5 can drawing , but I cannot find any function to save.
I can write the PHP server side code for save the areas and link information to database.

Appreciation any suggestion.
0
I have a legacy script for a client that I'm trying to get their original authorize.net coding to work with the new acceptJS coding format.

The following code makes a call out to a credit card processing service (authorize.net).  When it returns with validated info, it pops up a dialog box that the person then responds to in order to finalize the processing.

When it makes the call to authorize.net, a token is returned. But because JavaScript is running in asyncronos mode, if the person is on a slow internet connection, the box pops up before a reply has been received from authorize.net.

What I need to have this do is to postpone the processing of the popup dialog until I get a valid answer of either "Error" or "Ok" from authnet. Anything else should wait for that reply.

In the script below, the call to auth.net is made on line 23:  var resp = sendPay2Auth(apiLoginID, clientID, extr);

On the next line it then looks for the value of resp.respcd.  If it says, "Error" it returns false and thus the dialog box does not pop up.

If it returns "Ok" it pops up the dialog box for them to continue.

But the problem is if the call to authorize.net has sent back a response yet, it gives a value of "undefined" in which case it then just does nothing at this point. Which leaves the customer hanging.

So what I'm looking for is how to code this so that the script will just "wait" until it gets back either an "Ok" or and "Error" in the field designated as …
0
I have an HTML form with some checkboxes and a couple of required fields on it.  I need the submit button to check that at least 1 checkbox is checked and the 2 required fields have values.  Right now, clicking submit doesn't do anything on the form.  Does the logic of the function and submit button look correct?

The Function:

<script type="text/javascript" language="javascript">
function validateFormFields() 
    {
		var checkboxes=0;
		
        if (document.getElementsByName('_1_1_2_1') == "")
        {
            alert('Please make a selection before submitting the form');
            return false;
        }
        else if (document.getElementsByName('_1_1_3_1').value == "")
        {
            alert('You must make a selection before form submission');
            return false;
        }
		else if 		
	   	(document.getElementsByName('_1_1_62_1').checked) ||(document.getElementsByName('_1_1_61_1').checked) ||
                (document.getElementsByName('_1_1_60_1').checked) ||(document.getElementsByName('_1_1_59_1').checked) ||
                (document.getElementsByName('_1_1_57_1').checked) ||(document.getElementsByName('_1_1_56_1').checked) ||
                (document.getElementsByName('_1_1_54_1').checked) ||(document.getElementsByName('_1_1_53_1').checked) ||
                (document.getElementsByName('_1_1_52_1').checked) ||(document.getElementsByName('_1_1_51_1').checked) ||
                (document.getElementsByName('_1_1_50_1').checked) 

Open in new window

0
Hi. I am trying to create a solar system. The sun, earth and mars displays fine and the earth and mars rotates around the sun. My problem is that the stars do not appear and the keydown event does not work. Any help would be very much appreciated. Thanks.

Code:
***********************************************************************
<body></body>
<script src="http://gamingJS.com/Three.js"></script>
<script src="http://gamingJS.com/ChromeFixes.js"></script>
<script>

  // This is where stuff in our game will happen:
  var scene = new THREE.Scene();

  // This is what sees the stuff:
  var aspect_ratio = window.innerWidth / window.innerHeight;
  var above_cam = new THREE.PerspectiveCamera(75, aspect_ratio, 1, 1e6);
  above_cam.position.z = 1000;
  scene.add(above_cam);

  var earth_cam = new THREE.PerspectiveCamera(75, aspect_ratio, 1, 1e6);
  scene.add(earth_cam);
  
  var camera = above_cam;
  
  // This will draw what the camera sees onto the screen:
  var renderer = new THREE.WebGLRenderer();
  renderer.setSize(window.innerWidth, window.innerHeight);
  document.body.appendChild(renderer.domElement);

  // ******** START CODING ON THE NEXT LINE ********
document.body.style.backgroundColor = 'black';

var star = new THREE.SphereGeometry(50,28,21);
var surface = new THREE.MeshPhongMaterial({ambient: 0xFFD700, color: 0x0000cd});
var sun = new THREE.Mesh(star, surface);
scene.add(sun);

var planet = new THREE.SphereGeometry(20,20,15);
var surface = new 

Open in new window

0
Here's my code..
    <script>
        $(document).ready(function () {
            $("#btnSaveEmployeeData").click(function (event, ui) {
                window.location.href = ui.tab;
            });
        });

   
    </script>

Open in new window


Why I'm getting "object expected" error when btnSaveEmployeeData is the button id?
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.