[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x

JavaScript

121K

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

I want to show the text  as VIEW when  mouse over the image.
<img  src="images/<%# DataBinder.Eval(Container.DataItem, "idProduct") %>.jpg"  onmouseover= xxxxxx  onmouseout="this.src='<images/<%# DataBinder.Eval(Container.DataItem, "idProduct") %>.jpg'"> 

Open in new window


Please advise! Thank you!
0
Microsoft Azure 2017
LVL 12
Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

I have a small image on the right with scroll, when users click the small image, it will display a bigger image and when users click the big image, it will enlarge the image. When users click the large image. On the bigger image, there is a button link. When users scroll select the first image, the button link will direct the user to a new link page with this selected image.
Can someone give an example?
0
I have a small image on the right with scroll, when users click the small image, it will display a bigger image and when users click the big image, it will enlarge the image. When users click the large image. On the bigger image, there is a button link. When users scroll select the first image, the button link will direct the user to a new link page with this selected image.
0
I have a datalist.

1. When users mouse over the image, it shows the quick view(the quick view is stylish with background and bolded)
<img src="images/<%# DataBinder.Eval(Container.DataItem, "idProduct") %>.jpg" title="Quick View"/>

Open in new window


2. when user clicks the hyperlink, it  pops up the window and grays out the background page,
<a href="javascript:Openpopup('product.aspx?id=<%# DataBinder.Eval(Container.DataItem, "idProduct") %>')">

Open in new window


Currently I have made the pop up window work, but I cannot gray out the background page. I can add the title "Quick View", but I cannot style it.

3. Here is code I currently work on.
<script language="javascript" type="text/javascript">
function Openpopup(popurl)

{
	
	 var width = 500;
      var height = 500;
	   var top = parseInt((screen.availHeight/2) - (height/2));
	  var left = parseInt((screen.availWidth/2) - (width/2));
winpops = window.open(popurl,"","width=500, height=500, left="+ left + ",top=" + top + ",screenX=" + left + ",screenY=" + top)



	
  </script>  




<asp:DataList ID="dg"  runat="server" HeaderText="" HeaderStyle-BackColor="#fff" HeaderStyle-ForeColor="#FFFFFF" HeaderStyle-Font-Bold="true">

                                   <ItemTemplate>
								   
	

<table>

      <tr>
		<td> <a href="javascript:Openpopup('product.aspx?id=<%# DataBinder.Eval(Container.DataItem, "idProduct") %>')">
<img src="images/<%# DataBinder.Eval(Container.DataItem, "idProduct") %>.jpg" title="Quick View"/></a> 

</td>
	</tr>

</table>
					

									       
					          </ItemTemplate>
									
</asp:DataList>

Open in new window

0
example of mobile website in iframe and in simulatorexample of mobile website in iframe and in simulatorHi I would like show a mobile version website in my website on a desktop computer, how I can do it?
-I was thinking using an iframe, but they show me the desktop version inside the iframe.
- I tried to change the user-agent of the iframe but doesn't work for me (maybe is possible)
- I don't want use chrome inspector to achieve this.
- I don't want use version like m.website.com because I don't know how to generate all the different URL
- I prefer a client solution without server if is possible
- I there is a solution I'll love have some working code

(for instance you can try https://www.linguee.it/)
Thanks

(for instance you can try https://www.linguee.it/)
Thanks
1
Coldfusion 10 Websockets Algorithm. I'm adding functionality to a simple coldfusion websocket chat application. The added functionality is 1) to display the name and picture of the person who is in the chatroom  and 2) to have a text file that all users can modify. I'm currently working on #1 but I just realized that I'll have to change the way the publish calls are made if I want to account for multiple operations. My question is: What is the best way to implement a ColdFusion websocket app to account for multiple actions. I understand that the publish method can accept "custom header" information so I'm following that methodology but I'm not sure how to read the header info and if I should do that on the javascript part or the server messageHandler. I'm passing in the info like this:  

wsObj.publish("ch1",'Hello World', {ui_trigger:  'btn3', empoyeeId: '12345'});

Does that seem right or is there a better way of doing it? I'm trying to capture the btn3 and 12345 data.

I have read websocket documentation and read multiple google searches for this but haven't really found a good example.
The main thing that I want to accomplish is to separate all actions and handle them all differently but to make sure all the data gets published to the other clients.
Application.cfc.txt
index.cfm.txt
postMaker.cfc.txt
ws.js.cfm.txt
0
Is it possible to destory a bind on the DOM and recreate it ? let say i add data to a table from a Ajax request i would need to rebind that to the dom for the new inserted data ?
1
var jrID = ('a',$(this)).attr('data-id');

Open in new window


Why is this not giving me the id ?
1
We are looking for a contractor on an as-needed basis to work on our small team of developers to do programming:

ASP.NET framework
HTML5
Javascript
Web Services

I will be interviewing applicants with specific questions. Then we will discuss the specifics of the project.

The contractor doesn't have to be from the U.S. but we need a way to make payment via U.S. funds easily.

thanks!
0
Hello,
I'm working on a code that can record vocal messages and store them into a database to retrieve them later on, but my PHP script isnt working and I don't have enough expertise in web dev to correct it, can someone help me please ?
index.html
upload.php
app.js
0
Bootstrap 4: Exploring New Features
LVL 12
Bootstrap 4: Exploring New Features

Learn how to use and navigate the new features included in Bootstrap 4, the most popular HTML, CSS, and JavaScript framework for developing responsive, mobile-first websites.

Dev Question

So i have this data coming from a table which is a time 00:03:22.

how can i format this in js to the user to be like 3min 22 seconds ?
1
How would I get the value of "You must accept the Bank of the West terms before registering." from the below, when displayed to user?  The only thing I see that is different is the div 2 before the value I want, has a class of "c-alert__icon--big c-alert__icon--error".
<div class="c-alert__container js-notifications">
<div aria-live="assertive" class="alert c-alert c-alert--floating c-alert--success fade is-hidden js-changes-saved-notification js-floating-alert show" role="alert" tabindex="0">
<div class="d-flex">
<div class="c-alert__icon--big c-alert__icon--success">
<div class="fal fa-check-circle c-icon"></div>
</div>
<div class="c-alert__text c-alert__text--floating js-notification-message">Changes successfully saved</div>
</div>
<div class="c-alert__close c-alert__close--floating">
<a aria-label="Close" class="btn btn--circle btn--disguised btn--close js-floating-alert-close" href="#">
<div class="icon--utility__close icon--utility far fa-info-circle c-icon"></div>
</a>
</div>
</div>

<div aria-live="assertive" class="alert c-alert c-alert--floating c-alert--success document-uploaded-notification fade is-hidden js-document-uploaded-notification js-floating-alert show" role="alert" tabindex="0">
<div class="d-flex">
<div class="c-alert__icon--big c-alert__icon--success">
<div class="fal fa-check-circle c-icon"></div>
</div>
<div class="c-alert__text c-alert__text--floating js-notification-message">Document uploaded successfully.</div>
</div>
<div 

Open in new window

1
Dear All,

I have a device (installed on vehicle) which sends latitude and longitude on the Server through GPS. I have a route of that vehicle which is successfully plotted on Google Map.

My Problem is how can I plot latitude and longitude at runtime on Google Map in PHP dynamically on Desktop Application. I want to plot fetched latest latitude and longitude on Google Map to show where the vehicle is running.
0
We have a touchscreen kiosk done in Hype we are having an issue with certain behaviors that work when a mouse is used but do not work when using the touchscreen. The issues only occur in a couple of places within the app and we are having a difficult time figuring out why this is occurring. Everything works fine on all of the other kiosks that the application is running on but this particular one is having issues.  Here is the javascript from the page that does not function properly.
	$("#rotateCCW").on("click", function(){
		
		hesitateCCW();
	});
	
	function rotateCCW(){
	
		resetAirflow();
		var start = getRotationDegrees($("#sail"));
			
		var end = start - 60;

		$("#sail").rotate({ angle: start, animateTo: end, duration: 200});		
	}
	
	function hesitateCCW(){
		setTimeout(rotateCCW, 400);
	}
	
	function resetAirflow(){
		
		$("#airflow-sail_correct").hide();
		$("#airflow-sail_incorrect_30").hide();
		$("#airflow-sail_incorrect_90").hide();
		$("#airflow-sail_incorrect_150").hide();
		$("#airflow-sail_incorrect_210").hide();
		$("#airflow-sail_incorrect_neg_150").hide();
		$("#airflow-sail_incorrect_neg_90").hide();
	}

	$("#rotateCW").on("click", function(){
		hesitateCW();
	});

	function rotateCW(){
	
		resetAirflow();
		var start = getRotationDegrees($("#sail"));
			
		var end = start + 60;

		$("#sail").rotate({ angle: start, animateTo: end, duration: 200});		
	}
	
	function hesitateCW(){
		setTimeout(rotateCW, 400);
	}
	
	function resetAirflow(){
		
		

Open in new window

0
Hi Experts,

      I am not able to create Green checkbox.  Please the below image you can see the html code and css and gui(how it looks).  I am not able create Green checkbox
 
Capture.JPG

the html code I have is

input.green-check:checked {
  background-color:#5cb85c;
  border-color:#5cb85c;
}

Open in new window


react js code

           (<div className="checkbox checkbox-success">
                              <input type="checkbox" className="green-check" value={j.value} checked={j.selected} key={j.value}  onClick=
                            {(e) => this.props.actions.updateFacet(i.key,j.value,true,false)}
                          />
                           <label>{` ${label}${count}`} </label>
                          </div>)

Open in new window


the check box I need is
 
 test.jpgPlease help me in finding a solution.

With many thanks,

Bharath AK
0
What's the JS regex for the below where I can have "we" and then possibly some characters followed by ".bank.com?:


wedev.bank.com
weqa.bank.com
weuat.bank.com
westage.bank.com
we.bank.com

Thanks!
0
Trying to demonstrate a web worker API to my Web Development students and I wanted to make the process of changing a color image to grayscale in the worker. I know it doesn't take much processing but I'm just using it as an example. I have the grayscale working fine when it's not separated out into a websworker ( jvalencia.ceiwd.com/contoso/badge1.html ) but when I put the code into a webworker the progress bar works but the grayscale image doesn't work--the color image is loaded. ( jvalencia.ceiwd.com/contoso/badge.html )  What am I missing?

WORKING (With no Web Worker):

function showImage(file) {
      reader = new FileReader();
      reader.onload = function (event) {
            console.log(event.target)


            
            if (holder.getContext !== undefined) {
                  var context = holder.getContext('2d');
                  var destX = 0;
                  var destY = 0;
                  var imageObj = new Image();
                  
                  imageObj.onload = function() {
                        context.drawImage(imageObj, destX, destY, holder.width, holder.height);


                        var imgData = context.getImageData(0, 0, holder.width, holder.height); //get image from badge
                        var pixels = imgData.data
                        console.log(pixels);

                        for (var i = 0, n = pixels.length; i < n; i += 4) {
                            var grayscale = pixels[i] * .3 + pixels[i+1] * .59 + pixels[i+2] * .11;
                            pixels[i  ] = grayscale;        // red
                                 pixels[i+1] = grayscale;        // green
                            pixels[i+2] = grayscale;        // blue
                            //pixels[i+3]              is alpha

                            var…
0
Hi All,
Advance thanks
Please find the column name in jqgrid. how to pass row value to java script function



colModel: [
                              {
                                    Key: false, name: 'AmendmentNumber', index: 'AmendmentNumber', width: 150,      
                              },      
Key: false, name: 'DAPCloserDts', index: 'DAPCloserDts', editable: true, width: 100,
                                    cellattr: function (rowId, tv, rawObject, cm, rdata) {
                                          return 'onClick="javascript:showDapData(' + $.jgrid.getXmlData( rawObject, "AmendmentNumber" )+ ')"';
                                    },},

                ],

function showDapData(id) {
            alert(id);
});

Kind regards,
Pooja
0
I recently added a Google Translation widget to a website that I'm working on, and succeeded at applying some customization to it.  More specifically, I achieve the following:

1) I was able to customize the appearance of the dropdown by removing the google icon, and also changing some of the CSS properties (ie: removed border, changed background color, font, font weight and color, etc).  

2) I added some custom JavaScript that allows me to change the default text that's initially shown in the dropdown from "SELECT LANGUAGE" to "ENGLISH".

I'm running in to some problems, however, and am hoping someone here can help me fix them.  

1) I'm getting some JavaScript errors in the console .. namely "Too much recursion".. which I'd like to resolve/eliminate somehow.

2) If possible, I'd like to replace my custom JavaScript with some vanilla JavaScript (so I can eliminate the need to have to include the JQuery library).

3) Currently, once a different language is selected, .. the default text in the dropdown doesn't change to the selected language as it should (the language on the page changes -- but the word "ENGLISH" remains pre-selected in the dropdown).  Ideally, I'd like it so that when a user chooses "Spanish" from the list of available languages, .. the default text in the dropdown would change to "SPANISH" .. or to the uppercase version of whichever language was selected.

My code is below.  Note that it can be copied and pasted and that it runs just fine …
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.

How to loop through an Array in Java script where i am getting data from c# code as dictionary

private Dictionary<string, object> _dic = new Dictionary<string, object>();

        public Dictionary<string, object> dic
        {
            get
            {
                return _dic;
            }
            protected set
            {
                _dic = value;
            }
        }
 public string MyDictionaryToJson()
        {
            string jsonString = (new JavaScriptSerializer()).Serialize((object)_dic);
            return jsonString;
            //var entries = _dic.Select(d =>
            //    string.Format("\"{0}\": [{1}]", d.Key, string.Join(",", d.Value)));
            //return "{" + string.Join(",", entries) + "}";
        }
        private static Random random = new Random();
        public static string RandomString(int length)
        {
            const string chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
            return new string(Enumerable.Repeat(chars, length)
              .Select(s => s[random.Next(s.Length)]).ToArray());
        }
        private DataTable BindData()
        {
            


            DataTable dataTable = new DataTable();
            dataTable.Columns.Add("ColId", typeof(string));
            dataTable.Columns.Add("ColValue", typeof(string));

            for (int i = 0; i < 50000; i++)
            {
                dataTable.Rows.Add(i.ToString(), RandomString(5));

            }
            foreach 

Open in new window

1
I have a script tag that is being inserted dynamically thru a plugin to which I don't have access too. When the site is converted to HTTPS this script tag is causing the issue of mixed content and displaying an insecure message.

The script tag is in the head tag like below

<head>
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?key=xxxxxxxxx"></script>
</head>

Open in new window



I am trying to change that

<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=xxxxxxxxx"></script>

Open in new window


Any advice is appreciated. The developer no longer supports the plugin so no help from that side. Also this is NOT a WordPress site

Thanks
0
Hi

I'm not a big fan of Googles reCAPTCHA  having clicked on 100's images of traffic lights, bicycles  and fire hydrants to be asked please try again

However can someone explain how  to validate it prior to submitting a form?

I'm assuming this is done within a JavaScript onSubmit function ??

I'm also assuming Is there no PHP  validation as reCAPTCHA  is a JavaScript library so if   isn't enabled reCAPTCHA   wont work


The code bellow is just to get going
<?php
error_reporting(E_ALL); 
$submit = filter_input(INPUT_POST, "submit");
if($submit){
  // validate form 
  $html = "<div>Hello Thank you for your message</div>";
  }
 
?>

<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
  <head>
    <meta charset="UTF-8">
    <title>Send a Message</title>
    <script src='https://www.google.com/recaptcha/api.js'></script>
      <script>
    function onSubmit() {
      document.getElementById("MyForm").submit();
    }
  </script>
  </head>
  <body>
    <?php
    if ($html){
    echo $html;
      }
    else
      {
      
      
    ?>
    <div class="FormWrap">

          
  <fieldset>

          
    <legend>Email Form</legend> 

          
      <form id="MyForm" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">

          
      <p><label for="Fname">Enter full name</label><input type="text" 

Open in new window

0
If there are two instances this returns
var welcome = $("a.c-nav__link.js-nav__link.align-item-center.c-nav__link--flex.active").text();

Open in new window

How do I get the first occurrence of the words? I tried welcome[0] but that only returns the first letter? Sometimes there is only one word but sometimes there are two words:

"Loan Applications

Loan Applications"

or

"Borrower

Borrower"
1
Hello!

I'm new to building an Amazon Alexa skill and the course I'm taking seems to be a bit outdated. In the course, it says to use event.request.intent to get the intent of the user. However, I'm getting an undefined error. Should I be using something else to get the intent?

exports.handler = function(event, context) {
    console.log(event.request.intent);   
}

Open in new window


Produces this error
TypeError: Cannot read property 'intent' of undefined
Screen-Shot-2018-11-09-at-2.07.39-PM.png
0
Hello Experts -

I'm  using the datePicker jquery plugin for a calendar dropdown date selection, and I want to exclude weekends and holidays. I've got the weekends disabled (see Javascript function below), but would like to disable holidays as well, as defined by the array in the code below. Could someone show me how to reference the Date.prototype.holidays array to exclude holidays from the datePicker calendar?

Thank you!


$(document).ready(function () {
            $(".date-pick").datepicker({ startDate: '01/01/2000', clickInput: true, beforeShowDay: $.datepicker.noWeekends });
        });

Date.prototype.holidays = {all:['0101','0704','1225'],
         2018:['0903','1122','1123','1226','1227','1228','1231'],
         2019:['0527','0902','1128','1129','1226','1227','1230','1231'],
         2020:['0525','0907','1126','1127','1228','1229','1230','1231'],
         2021:['0531','0906','1125','1126','1227','1228','1229','1230','1231'],
         2022:['0530','0905','1124','1125','1226','1227','1228','1229','1230'],
         2023:['0529','0904','1123','1124','1226','1227','1228','1229']};

Open in new window

0

JavaScript

121K

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.