Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17







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 have two rather dated reaction time javascripts. They work fine however each have slight issues.
Please tell me if there are any quick fixes for:


When viewed from an android tablet and android media box, the popup box that returns the user's result has the following extra language a the top: "the page at says:"

Is there any way around this, because it's bothersome. The browser on my tablet is FF and the browser on the android box is the generic android browser.


Is there a way to add a reset button to the existing script so that the previous scores are deleted before the user plays again?

Although I've moved forward I'm  Using the as a start point I have a couple  of further questions

1 Why isn't the icons / markers blue I've tried using relative path and absolute but the  marker stays the default red
My point is I can't change the marker.

2 how do I ensure only 1 popup box is open at once
<!doctype html>
    <title>OpenLayers Click Event Example</title>
  <script src="//"></script>    </head>
    <body onload="init()">
    <div class="wrapper">
        <div class="container">
        <h1 >OpenLayers Click Event popup</h1>
      <div class="container">

    <div id="mapdiv" style="width: 800px;height: 500px " ></div>
      <h2>Custom Data for clicked item</h2>
      <pre id="result"></pre>
    <script src=""></script>
    <script type="text/javascript">
      //Set up a click handler
      OpenLayers.Control.Click = OpenLayers.Class(OpenLayers.Control, {                
        defaultHandlerOptions: {
          'single': true,
          'double': false,
          'pixelTolerance': 0,
          'stopSingle': false,
          'stopDouble': false
        initialize: function(options) {
          this.handlerOptions = 

Open in new window

i want to export HTML/CHART to PDF and excel
how can i do?.
Hello guys,

I have this code bellow that is created by my system:

    <meta http-equiv="X-UA-Compatible" content="IE=11">
    <script type="text/javascript" src=""> </script>
    <script type="text/javascript">

    function matriz(indice, geocoder, nomeCidade, cor, latlng, info, qtdLoja, checkbox) {
        this.indice = indice;
        this.geocoder = geocoder;
        this.nomeCidade = nomeCidade;
        this.cor = cor;
        this.latlng = latlng; = info;
        this.qtdLoja = qtdLoja;
        this.checkbox = checkbox;

    //cria variáveis globais a serem usadas
    var map;

    var aCliente = new Array;
    var aGeocoder = new Array;

        aGeocoder[0] = new google.maps.Geocoder();
    function geocoderCallBack0(point) {if (!point) {} else {map.addOverlay(createMarker(point,0)); }};
    aCliente[0] = new matriz(0, aGeocoder[0], "SAO PAULO", "yellow", "-14.2350040,-51.9252800", "4 - BARCLAYS<br/>FATURAMENTO,40<br/>SAO PAULO - SP<br/>Fone: (55) 5555555",
    "{qtdLoja}", "{checkbox}");

    aGeocoder[1] = new google.maps.Geocoder();
    function geocoderCallBack0(point) {if (!point) {} else {map.addOverlay(createMarker(point,1)); }};
    aCliente[1] = new matriz(1, aGeocoder[1], "SAO PAULO", "yellow", "-23.5871900,-46.6752099", "5 - BANCO BNP PARIBAS BRASIL S.A.<br/>AV PRESIDENTE JUSCELINO 
KUBITSCHEK,510<br/>SAO PAULO - SP<br/>Fone: () ",  "{qtdLoja}", 

Open in new window


I am implementing a Web page in JavaScript with Angular.JS & ionic. A page generator is one of the menu items that has a header field where the user can load a file. With the [Save] button, the result is sent to the relational database.

The page generator is saving the whole generated HTML object in the database like

	<div class="hero-image" ivm-bg-axis="y" ivm-bg-drag="" ivm-bg-disabled="disabled" ng-style="" ngf-background="ngModel" style="background-image: url(&quot;blob:null/3dfb1617-e1c8-45e8-9c0e-5f772129d2cb&quot;);"></div>

Open in new window

where the image is denoted with style="background-image: url(&quot;blob:null/3dfb1617-e1c8-45e8-9c0e-5f772129d2cb&quot;);. This is probably the unique key of the cached browser object, is it? If so, I want to save this image as a BLOB object, say, in another field of the same database record.

Question: How is it possible to get this image out of the browser? Is there a difference getting out this information between different browsers?

Thank you for your reply!
I have the javascript where I am trying to do a simple show / hide of the div. but it does not work . please advice
Hi - I have the below line in my jsp and i am getting error saying
unterminated &lt;

var myString = "<img src='images/clear.gif' width='8' height='5'><mytags:dropdown  fieldID=" +"'"+ extDataID+ "'"+" category= " +  '<%=com.test.myString.GET_VALUE_TEST%>' + " selectedOption='' style='InputFields'/>";

Open in new window

so what is wrong in the above syntax is javascript not accepting <%= %>

I can pinpoint the error to this line because when i replace the above line with the below line no issues
var myString = "<img src='images/clear.gif' width='8' height='5'><input type='text' name=" +"'"+ test+ "'"+" maxlength = '40' size='64' value='' class = 'InputFields'>";

Open in new window

I have what seems impossible.

Note these code sections. First, a form field called "agency", done like this:
<div class="row">
	<div class="col-sm-6 col-xs-6 text-right" style="padding-top:3px;">Agency:&nbsp;</div>
	<div class="col-sm-6 col-xs-6 text-left"  style="padding-top:3px;"><select name="agency" onChange="set_form();">
	<option value="">-- Select Agency -- </option>
	<? for ($i = 0; $i < $nf; $i++) {
		$f = mysqli_fetch_array($resf,MYSQLI_ASSOC);
		$sel = "";
		if ($_SESSION['form'] == $f['agency']) {
			$sel = "selected";
		} ?>
		<option value="<? print $f['agency']; ?>" <? print $sel; ?>><? print $f['agency']; ?></option>
	<? } ?>	

Open in new window

Next, the javascript function set_form(), like this:
function set_form() {
		t =;
		if ( != "Houston") {
			if (free == "FR") {
				jj = confirm("This form requires subscription fee. Continue?");
				if (! jj) { = "Houston";
					return false;
				} else {
					alert("going to subscriben."); = "subscribet.php?fr=f&ag=" +;;
		}"save_form.php?t=" + t;;

Open in new window

Finally, the code in subscribet.php:
echo "entered subscribe test<br>";

Open in new window

Note  the alerts in the function set_form(). When I pick a value other than Houston from the dropdown, the alerts display, but but NEVER goes to subscribet.php.

Obviously I have tried to break this down to it's simplest elements. The "real" subscribe.php program does much more.

The result is that it jumps to another version of the first program called form.php.

If it drops through to the end of set_form(), it will go to save_form.php which will have the effect of what is happening. The way I see the logic, that is impossible.

I am probably just missing the obvious. I have tried running this in Firefox with Firebug turned on & Chrome with F11. They show nothing.

Can someone see what is wrong?

I need to align the menu at the bottom under manufactures in a way where it has a grid like pattern or at displays the names even.  As you can see the some of the names of the companies are longer than the others and it's making the grid uneven.

Thank you anyone who can help?!
Trying to find the simplest/best solution for a scrolling banner, right to left,  that i can control the speed.  I have 7 brand logos I want to display, horizontally, and would like them to be linkable.  Any suggestions?  I have been looking around, but nothing is quite what I am looking for.
I have a script that has an on state and off state that are represented by images. What I would like to have is a 3rd image  state that is displayed when the user hovers, to show that the images are clickable, currently there is a div that changes content depending on the image that is selected.

Here is the current script

<script type="text/javascript">
            var preIndex = 0;
$("#divNavigate .imgNav").click(function() {
  var ix = $("#divNavigate .imgNav").index($(this));
  $("#divContent .tab:eq('" + preIndex + "')").hide();
  $("#divContent .tab:eq('" + ix + "')").show();
  $("#divNavigate .imgNav:eq("+preIndex+")").attr("src","images/tab_"+preIndex+"_off.png");
$("#divNavigate .imgNav:eq("+ix+")").attr("src","images/tab_"+ix+"_on.png");
  preIndex = ix;

$("#divNavigate .imgNav:eq(0)").click();


Open in new window

Hi - I have a table with default 10 rows and now i had a button to add 10 more rows, so when i click on that button new 10 rows must be appended to the table at the bottom.

The table has 4 columns
Label - simple label
integer - shows the count
dropdown - dropdown values to select

Now i wrote the javascript function for this as below but it has one problem
I am not able to assign unique id to each dropdown select - for example by default we have 10 rows so dropdown id fro those 10 rows are id1,id2,id3,.... id10
now when i click on add 10 rows button the new rows should have id's id11, id12, id13.... id20
so it depends on table length

function addDataRows(divname) {
   var tabObj = document.getElementById("detailTable");
var tableSize = tabObj.rows.length+1;
var strid = "id"+(tableSize+1);
   var newDiv=document.createElement('div');
   var html = '<select id = "<%=strid %>" ' + 
		'<option value="volvo">Volvo</option>' +
		'<option value="saab">Saab</option>' +
		'<option value="opel">Opel</option>' + 
		'<option value="audi">Audi</option>' + 
   newDiv.innerHTML= html;
function addLRows(divname) {
   var newDiv=document.createElement('div');
   var html = '<input type="text" name="firstname" value="Mickey" maxlength="40" size="64" ><br />';
   newDiv.innerHTML= html;
function add10rows(Container1, Container2){

Open in new window

I want to have bigger height to overall div below. What to adjust?
                <div class="imagesList-item-frame shadow"/>
                    <img src=<%=lb_pict5.Text %> onclick="pict_click5();" />
                    <div class="legend">
                        <input type="textbox" id="tb_p5_desc" style="height:20px; width:116px; border:inherit; background-color:#C5C4CC;" runat="server" /><label id="show5"></label>
                        <input type="text" id="tb_p5_desc2" style="height:20px; width:118px; border:inherit; background-color:#C5C4CC; display: none" value="TEST:" runat="server" />
                        <!---span>Some descriptions here</span><br /--->
                        <input type="button" id="butt_p5" onclick="openPopup5();" style="height:26px; width:97px" value="删除照片" runat="server" />

Open in new window

I want to build a web app that has a lookup field on my form to get data from a 3rd party Restful api.  It would make a url call to the service like : It passes 1 value.  That call would return 4 values.  Those values would populate my 4 form fields.  Upon save, I would save that data to my database. I planned to use c# and javascript and a MSQL or MySQL db.   I'm open though since it's from scratch.  I'm looking for maybe a HTML, Javascript, DB example or HTML, Javascript, DB, C# or PHP example.  Does anyone have an example of how to do that?
I have an website that uses ajax and javascript.

I changed the javascript variable name but when i run the website and view the code i see the old vairable name. How do i get the progarm to use the new information.

I tried clearing the cookies and press f5

My button don't work but alert work after success, what should I do ?

<!DOCTYPE html>
<html lang="fr">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="icon" type="image/gif" href="img/drapeauBruxelles.gif" />
    <link rel="stylesheet" href="css/bootstrap.min.css">
    <link rel="stylesheet" href="css/style.css">
    <title>Projet Map</title>
       #map {
        height: 600px;
        width: 90%;
    <div class="container-fluid bg-2 text-center">
      <h1 class="margin">Des Marqueurs Google Maps</h1>
    <div id="map"></div>
    <nav class="navbar navbar-default">
      <div class="container">
        <div class="navbar-header">
          <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          <a class="navbar-brand" href="">My Google Maps</a>
        <div class="collapse navbar-collapse" id="myNavbar">
          <ul class="nav navbar-nav navbar-right">

            <li><button type="button" id="btn1">Fontaine d'eau</button></li>
            <li><button type="button" onclick="actionImmediate();">Fontaine d'eau</button></li>

Open in new window

I have been in the world for while and built web sites with membership.  I want to use better technology to build Web Apps with security.  Basically, a web based software.  I know this is probably a dumb question, but what is the best stack to make this happen today.  I am familiar with most technologies.  I am better at Web Front End development.  I will also need to be able to consume data from a REST API Jason for my project.  The app will have user and role based security. Can anyone provide some direction?

Web app (software like an accounting app)
User and Role based for data views
Not currently tied to any technology (ie. .net, javascript, Node.js, MSSQL, MySQL, Stateless...)
Hi experts, I want to pick some data on the table with an id="myTable" and put it to another div to form another table. My code below seems working but missed one of the data from the row since I want to make a group of two per row. I attached the html here to make it easy to understand for the experts. My goal here is to form a table on a div, a table that has two td per row. Base on the code i created there are 7 items available on the table so, i could not group them by two. Is there any other technique to achieve the goal? Please help.
I am getthing this error message and con no see what is wrong.

The code is at

you will need to be login
User Name is rrr21
password is green2Apple$

after loging in go to home page and pick item
add the item to the cart
press the cart button at top of page
press the proced to checkout
press next (usp shipping)
press check out

When i press f12 i get the error

i attached the error message as an attached file
Here's my server side code but it postbacks and navigate to first tab. How to prevent that postback event/ action is my problem.

  {protected void lnkIssue_Click(Object sender, EventArgs e)

             txtIssuedID.Value = "";
             xtSummary.Value = "";
             txtDetailsIssue.Value = "";
             txtadvice.Value = "";
             txtaction.Value = "";
             txtAnalysis.Value = "";
             txtResolution.Value = "";
I want to call/executel the script below when I click the Li tag. What am I missing?

<li class="tabs" id="liNewIssue">New Issue</>

         $(document).ready(function () {
        $("#liNewIssue").click(function () {
Hi Following advise from here I'm attempting to build my table using Datatables

In the code bellow I get "TypeError: f is undefined  datatables.min.js (line 60, col 471)" so I'm clearly doing something wrong

I can't just load the data as I need to do stuff, I've added comments, while the data is loading I'm creating a Openlayers marker point (Outside this question scope)

The button is used to simulate the ajax call the table will need to be refreshed

Could someone give me a hand first fixing the error second how to get at & manipulate the data, as commented

<!DOCTYPE html>
    <title>Data Tables</title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <script src="//"></script>
    	<link rel="stylesheet" type="text/css" href=""/>
<script type="text/javascript" src=""></script>

<script type='text/javascript'>
	$(function() {
      // jQuery
       $('button').on('click', function (){
          var link = "MOCK_DATA.json";
//          $('#MainTable tbody').html(table);

Open in new window

I am using the following function in a website. Some said to use fidder but i can not see how to find the variable.

When i use a alert(Token) it comes with underfined. How can i see what the variable is in javascript.
  function SendForm()
               var Amount = $get("txtOrder").value;
               var OrderId = $get("txtAmount").value;
               var Email = $get("txtEmail").value;
               var FirstName = $get("txtFirstName").value;
               var LastName = $get("txtLastName").value;
               var Address = $get("txtAddress").value;
               var City = $get("txtCity").value;
               var State = $get("txtState").value;
               var Zip = $get("txtZip").value;
               var Token = PageMethods.GetToken(Amount, OrderId, Email, FirstName, LastName, Address, City, State, Zip);

    public static string GetToken(string OrderId, decimal Amount, string Email, string FirstName, string LastName, string Address, string City, string State, string Zip)

        return  CreditCardClass.CreditCardMain(Amount, OrderId, Email, FirstName, LastName, Address, City, State, Zip);
        // test of retrun
Hi Guys,

I'm trying to build simple online chat with this example:

I copied this code and it works good. Now I'm wondering how do I recognize who is me and who is the other client I speak with.

you can open this link above and see that "me" is hard coded.
I thought to create textbox and give to the users who want to chat then take this variable and put it in the method "insertChat(who, text, time = 0)"

Please, let me know which is the best idea to do so.
I've had this working for months and now nada. Not sure what changed.

On the homepage, I'm supposed to have things slide and fade in on scroll.
All js and css file paths appear to be accurate and I have the initializing code in the head.






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.