jQuery

17K

Solutions

5K

Contributors

jQuery (Core) is a cross-browser JavaScript library that provides abstractions for common client-side tasks such as Document Object Model (DOM) traversal, DOM manipulation, event handling, animation and Ajax. jQuery also provides a platform to create plugins that extend jQuery's capabilities beyond those already provided by the library.

Share tech news, updates, or what's on your mind.

Sign up to Post

Hi,

Where can I download bootstrap-multiselect.css and bootstrap-multiselect.js

I don't like to point to a different site to read those files
I like to have them in my folder.

Can you please help me find a site where I can save those two files to my folder.

I have search the web for hours and can't find a download to those files.

<link href="http://cdn.rawgit.com/davidstutz/bootstrap-multiselect/master/dist/css/bootstrap-multiselect.css"
      rel="stylesheet" type="text/css" />

<script src="http://cdn.rawgit.com/davidstutz/bootstrap-multiselect/master/dist/js/bootstrap-multiselect.js"
        type="text/javascript"></script>

Open in new window


Thank you for your help,
Lulu
0
PMI ACP® Project Management
LVL 13
PMI ACP® Project Management

Prepare for the PMI Agile Certified Practitioner (PMI-ACP)® exam, which formally recognizes your knowledge of agile principles and your skill with agile techniques.

I need to capture the exact time and write it to a sql server db via a classic asp web page.  I have a page that does that now...sort of.  It uses the Now() asp function.  The problem is that, if the internet happens to be slow where we are, by the time the command goes to the server, the time may not be as precise as we need.  Is there a way to capture that time client side (using javascript for instance) and then write it to the server, all with one button submit?

Thanks in advance for your help.
0
Hi Experts,

Can you anyone see why the Currency converter stopped working for some reason at https://www.aces-project.com/index.php/live-apps/

If you place a breakpoint at line 76 on https://www.aces-project.com/wp-content/themes/aces-project/live-apps.js, then run it, you'll notice that  I set my url appropriately on  Li. 35, but within my AJAX Call neither my url is appended from Li. 44 nor any data  is sent to the php script from Li. 49-52

Any help would be greatly appreciated.
Thank you!
0
Script for copying field values doesn't work in jquery-heavy site. How do I modify this to restore functionality? The script used to work fine, but when the application was upgraded and started using lots of jquery vs. the old stuff, the script stopped working. Is it merely a question of adding $(document.ready() { ...   to the right place?

<script language = "JavaScript">
               function copyToBusiness()
               {
       var f=document.forms["aspnetForm"];
       f.elements["ctl00$ctl00$mpcSingleContent$cntrlID_11155"].value = f.elements["ctl00$ctl00$mpcSingleContent$cntrlID_11148"].value;
        f.elements["ctl00$ctl00$mpcSingleContent$cntrlID_11154"].value = f.elements["ctl00$ctl00$mpcSingleContent$cntrlID_11147"].value;
               }
</script>

<a href="javascript:copyToBusiness()">Click to copy the Business Address below</a>
0
Hi,

I have two datatables in one html page.
One sorts dates fine, the other just don't.

See below for example.
01/03/2019 14:13:36      
01/03/2019 17:16:20      
01/04/2019 10:32:06      
01/10/2019 16:55:28      
12/06/2018 10:43:06

Please advise.
J.

HTML  I use

 '<div class="container">'
'<table id="example" class="display" style="width:100%">'
</table>

$HTMLEnd = @'
<script>
$(document).ready(function() {
    $('table.display').DataTable();
} );
</script>
'@
0
Hi Experts,

I have the following JS code set certain fields as required.

// set required to true or false
function setRequired(flag) {
  if (flag == true) {
    // get the current sig, default = []
    var sig = $('input[name="output"]').val();
    $('#cb_sign_wrapper').signaturePad({drawOnly : true}).regenerate( (sig) ? sig : [] );

    $('.req').each(function() {
      $(this).closest('tr').next().find('input').attr('required',true);
    });

    $('.req').each(function() {
      $(this).closest('tr').next().find('textarea').attr('required',true);
    });

    $('.req').each(function() {
        $(this).closest('tr').next().find('select').attr('required',true);
    });
  } else {

    $('input:required').each(function() {
      $(this).prop('required',false);
    });

    $('textarea:required').each(function() {
      $(this).prop('required',false);
    });

    $('select:required').each(function() {
      $(this).prop('required',false);
    });
  }
}

Open in new window


Wondering if there is a way to prohibit users from entering N/A or NA on these fields?

Thanks
0
Hi Experts,

How can I change the code below to

1- Only popup once.
2- Do not let the user exit the field without either entering required quantity of characters or leave it blank.

   $("textarea[id*=Treatments_Administered]")
       .attr("minlength", 100)
       .on("change blur", function() {
           if($(this).val().replace(/^\s*|\s*$/g,"").length<100) {
               alert("You must enter at least 100 characters!");
           }
   });

Open in new window


Thanks
0
jQuery (Javascript libraries) are bundled with a number of our
softwares (Weblogic, a supplier app, mobile app): quite a number
of XSS vulnerabilities were found by our pentester.

Q1:
One app vendor replied that updating (ie patching) or upgrading
jQuery may destabilize their app?  So are we supposed to wait
for these vendors to release their next release app so as to
bundle in newer & patched jQuery or we can get the patches/
updates from Oracle & just update/patch it??   Or by doing so,
we'll lose the support of the app vendor?

Q2:
In the case of Weblogic 12.2.1.3, jQuery ver 3.2 is bundled.
Since both Weblogic & jQuery are from Oracle, is it supported
if we just update jQuery (or there's no patch/update ie we
just have to upgrade jQuery to ver 3.3 or 3.4)?

Q3:
Is jQuery vulnerabilities the same as javascript (read at Oracle
site that jQuery is actually  javascript library) vulnerabilities?
0
Hi, Please see here: https://www.magickitchen.com/menu/thanksgiving.html. One of the items says Build your own Package or Add to your Order.

On that one, I'd like to hide the dropdown and the add to cart button.

The dropdown has a title of Nothing Selected. <button type="button" class="btn dropdown-toggle bs-placeholder btn-default" data-toggle="dropdown" role="button" title="Nothing selected"><span class="filter-option pull-left">Nothing selected</span>&nbsp;<span class="bs-caret"><span class="caret"></span></span></button>

Can I use Jquery to say, if this title says nothing selected, display none?

Ideally, I'd like to add a display:none to this div: <div class="order-form">, but just on that item.

The page is generated from a template, so I have to use an if query somehow, I don't want all order forms to disappear.

Thanks, I hope that made some sense.
0
I have the problem getting the column value in google chart. The data is presented in the array . From the array I need to get the value Z.

The code is below

<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>

	 	<script>
		

	function drawChart() {
	 	var data = new google.visualization.DataTable();
	 	//var clicktip='';
	 	
	 	
	 	data.addColumn('number', 'Month');
	 	data.addColumn('number',2017);
                data.addColumn('number',2018);
	 	
	 	
	 	//data.addColumn('number', 'sessionkey');
		//data.addColumn({role: 'tooltip', type: 'string', p: {html:true,trigger:'selection'});
		//data.addColumn({type:'string', role:'tooltip',p: {html:true}});  
		


    data.addRows([
      	
      		[{v: 3, f:'March',z:'242018'},null,8,]	,
      	
      		[{v: 6, f:'June',z:'242019'},null,13,]	,
      	
      		[{v: 7, f:'July',z:'242020'},null,10,]	,
      	
      		[{v: 11, f:'November',z:'272793'},null,5,]	,
      	
      ]);
     
    
     
    
     var options = {
        hAxis: {
            title: 'Month',
            showTextEvery: 1,
            legend: 'none',
            
            ticks: [{
                v: 1,
                f: 'Jan'
            }, {
                v: 2,
                f: 'Feb'
            }, {
                v: 3,
                f: 'Mar'
            }, {
                v: 4,
                f: 'Apr'
            }, {
                v: 5,
                f: 'May'
            }, {
          

Open in new window

0
Angular Fundamentals
LVL 13
Angular Fundamentals

Learn the fundamentals of Angular 2, a JavaScript framework for developing dynamic single page applications.

plugins.js keeps closing dreamweaver.  I cannot switch the path to match the other ones in script and I cannot open the file even.

<script src="assets/js/jquery-3.3.1.min.js"></script>
	<!--script src="../assets/js/plugins.js"></script-->
    <script src="assets/js/common.js"></script>
	<script src="assets/js/carousel_horizontal.js"></script>

Open in new window

plugins.js
0
I am trying to use this jQuery plugin but I cannot retrieve the entered data and associated emoji to send these data to a database via an AJAX call.

I can see the text and the emoji in the emojioneArea in the DOM but can't figure out how to extract them into a JavaScript variable.

I believe that I have followed the guidance in the emojioneArea GitHub examples but for me it does not work.  If I try to use the setText or getText methods the browsers tell me that they are not valid functions.

The screen scrapes attached are from IE11 but I have the same issue with Firefox.

Any assistance will be most appreciated and thanking you in anticipation.

Eric

From the DOM
The code I am trying
P.S., The alert returns no data but the length is correctly one.
0
Hello Experts,

I 'm new to JQuery and using Datatable(3rd party o plug-in) to show data(grid style) on the page. Once the record is inserted I want to update the grid(new record is inserted via button click which opens modal popup and later I'm refreshing the grid). But I'm getting "Not available" when destroying the datatable so I rebuild it again with new data. Below is the sample code.

HTML
<div class="table-responsive m-t-40">

                    <table id="dataTable" class="display nowrap table  dataTable" cellspacing="0" width="100%">
                        <thead>
                            <tr>
                                <th>First Name</th>
                                <th>Last Name</th>                               
                                <th>Phone</th>
                                <th>Email</th>                              
                            </tr>
                        </thead>
                        <tbody id="tblbody"></tbody>
                    </table>
                </div>

Open in new window


JavaScript
 $("#tblbody").empty();

                            data = JSON.parse(data);
                           $('#datatable').datatable().destroy(); -- Error here on  on Quick watch the value is "not available"
                            
                             -- Rest of the code doesn't execute due to error     
                            var html = '';
                            for (var i = 0; i < data.length; i++) {
                                var obj = data[i];

                                html += '<tr>'
                                html += '<td>' + obj.FirstName + '</td>';
                                html += '<td>' + obj.LastName + '</td>';                             
                                html += '<td>' + obj.PhoneNumber + '</td>';
                                html += '<td>' + obj.Email + '</td>';                                                                 
                                html += '</tr>'
                            }

Open in new window


If I comment $('#dataTable').DataTable().destroy() and try the above code I get a Warning message(popup) on the page and also tried $('#dataTable').DataTable().clear() it doesn't throw error but I got the same warning. Attached is the warning message.

Thanks,
ASPDEV
0
I have to implement the ability to check the number of characters with spaces in a text. The text contains html tags and I need to remove them. I am allowed to use JavaScript as well as jQuery. While I have no problems removing regular tags, the biggest problem is removing <ul><li> tags. The way both plain JavaScript (with regex) and jQuery handles them is that it removes those tags, but leaves them empty ; that is: with space.

What is the best method to count the characters with space based on this example text:

  • Siguiendo el modelo de los libros educativos, El príncipe ofrece consejos prácticos para conquistar y garantizar un gobierno monárquico.
  • Contenido: un soberano debería hacer todo lo posible para garantizar su reinado, incluso si esto significa que debe usar la violencia. Puede mantenerse en el poder con crímenes o asegurarse la lealtad del pueblo con buenas acciones. Para un príncipe, es mejor ser temido que amado. Sin embargo, debe satisfacer a sus súbditos, promover el comercio y evitar por todos los medios que su pueblo lo aborrezca. El soberano nunca debe subestimar el arte de la guerra.
  • El famoso e infame libro de Maquiavelo fue escrito en 1513, pero solo se publicó después de su muerte.
  • La Italia del siglo XVI no contaba con un gobierno centralizado, por lo que se convirtió en el trofeo de fuerzas externas.
  • Maquiavelo dedicó su libro a Lorenzo de Medici, a quien exigió tomar el poder en Italia y defender el país de los bárbaros.
0
Hi, I have a js script that I use to display a message and I need help editing the script to highlight parts of the rendered text.

The script generates a message like this:

This reservation is for a One Bedroom Condo for 3 nights arriving on Monday, September 24, 2019, and departing on Thursday, September 27, 2019, with the choice of No Tickets Included.

and I would like to highlight some parts of the text like this:

This reservation is for a One Bedroom Condo for 3 nights arriving on Monday, September 24, 2019, and departing on Thursday, September 27, 2019, with the choice of No Tickets Included.

On the script, I believe the section that displays the message is this:
 else {
      var descText = "";
      var roomTypeText = $("#roomTypeSel option:selected").text();
      if (roomTypeText) descText += "This reservation is for a "+ roomTypeText+" for  ";
      descText+=days +" night"+(days==1?"":"s")+" arriving on "+arrivalDate+" and departing on "+departureDate
      var ticketChoice = $("#Tickets option:selected").text();
      if (ticketChoice && ticketChoice!= "No Tickets") descText += " with the choice of " +ticketChoice;
      $("#description").html(descText);
      getPrice(dateString,days,roomType);

Open in new window


Please help me edit the attached file to get the desired result.

Note: By highlight, I mean bold text.

Thanks,

Jorge B
calendarmain.js
0
Hi, I have a js script that generates the date format without the day of the week like September 24, 2019, but I need it to display Tuesday, September 24, 2019. Could you please help me edit the script to make that change?

Thank you in advance for your help.

Jorge B.
calendarmain.js
0
I'm trying to post to an HttpHandler ashx file with parameters.

function sendClickData(methodName,paramValue) {
    
    try {
        // create web service param object
        var passUrl = "SetGridDefaults.ashx";

        // save data to web service using an ajax post method
        $.ajax({
            type: "POST",
            url: passUrl,
            data: "MethodName=SetDefaultGridView",
            success: function (data) {

            },
            error: function (error) {
                alert(error);
            }
        });
    } catch (e) { }

}

Open in new window


In the data row, I am passing values to be retrieved as query strings:

In my ProcessRequest, I am retrieving the value:

  Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest

        Dim method As String = context.Request.QueryString("MethodName").ToString()

Open in new window


When I run it, it gives me an error that the MethodName is null on the request.querystring line of code:
>>An exception of type 'System.NullReferenceException' occurred

This code was from an original article here:
original code

The only thing I see different is that it says to include an older version of jquery - version 1, whereas I am using version 3.

Also, in addition, I would like to pass two values if possible.

And yes, I know I can use a web service or API, but I was hoping I could use this, since it's just a very simple request.

Thanks!

Starr
0
I have a dataTable that I am building that switches between tile and list view. On the tile view I have inserted a row that is a new button which users can click to insert a new user. When the table is returning the number of records in the table it will include the NewButtonRow in the count.
For example, in the simplified table below I have one record, but the number of records returned will be 2 because of the NewButtonRow.
 <table id="TableTeamGrid">
            <thead>
                <tr>
                    <th>
                    </th>
                </tr>
            </thead>
            <tbody id="dataContainer" clientidmode="Static" runat="server">
                <tr id="NewButtonRow">
                               <td class="stylAddNewBtn"></td>
                </tr>
                <tr id="TileRow">
                               <td></td>
                </tr>
  </tbody>
 </table>

Open in new window

I need it to show 1(START) of 1(MAX or TOTAL) in the case of the simplified table above instead of 1(START) of 2(MAX or TOTAL).
I am using this dataTable here: https://datatables.net/.
These are the settings I have for the table:
$(document).ready(function () { 
  $('#TableTeamGrid').DataTable( {
"ordering": true,
"order": [ 1, 'asc' ],
"stateSave": false,
"serverside":   false,
"autoWidth": false,
"language": {
"lengthMenu": '<select>'+'<option value="10">10 per page</option>'+'<option value="20">20 per page</option>'+'<option value="30" selected>30 per page</option>'+'<option value="40">40 per page</option>'+'<option value="50">50 per page</option>'+ '<option value="-1">All</option>'+'</select>'  ,
"info": "_START_ of _MAX_"  ,
"paginate": {
"previous": "<<"  ,
"next": ">>" 
 }
 } ,
"pageLength": 30 ,
scrollResize: true,
scrollY: false,
scrollX: true,
scrollCollapse: true,
"dom": '<"stylTableMenu"filp>tB' 
});
});

Open in new window

0
I am trying to search the database column called "equipment" for multiple table models using sequelize. However, I am not receiving any data even though the fields are full. I am attempting to use the "Promise".  

However, if I simply call the model ( //boilerHouse.findAll({ where: { equipment_type: { [Op.in]: [req.params.name] } } }).then((data) => { ), I can search one table but not all.

router.get("/equipmentInfo/:name", (req, res) =>

 Promise.all([boilerHouse.findAll({ where: { equipment_area: { [Op.in]: [req.params.name] } } }), compressorHouse.findAll({ where: { equipment_area: { [Op.in]: [req.params.name] } } }), engineHouse33.findAll({ where: { equipment_area: { [Op.in]: [req.params.name] } } }), fireHouse.findAll({ where: { equipment_area: { [Op.in]: [req.params.name] } } }), hfoSeparator.findAll({ where: { equipment_area: { [Op.in]: [req.params.name] } } }), reverseOsmosis.findAll({ where: { equipment_area: { [Op.in]: [req.params.name] } } }), tankFarm33.findAll({ where: { equipment_area: { [Op.in]: [req.params.name] } } }) ])
.then((data) => {

  //boilerHouse.findAll({ where: { equipment_type: { [Op.in]: [req.params.name] } } }).then((data) => {
   
    res.render('gigs', {
      gigs:data,
         
     //data[0] is response from tableA find
     // data[1] is from tableB
      })   
    }).catch(err => console.log(err)));
    

Open in new window

0
Exploring ASP.NET Core: Fundamentals
LVL 13
Exploring ASP.NET Core: Fundamentals

Learn to build web apps and services, IoT apps, and mobile backends by covering the fundamentals of ASP.NET Core and  exploring the core foundations for app libraries.

I am trying to send the results for two(2) tables using sequelize, however only the results on either one table is printed. I would like both tables to print using promises. Here is the route code:

router.get("/alldataa", (req, res) => 

Promise.all([boilerHouse.findAll(), compressorHouse.findAll()])
.then((data) => {
  res.render('gigs', {
    gigs:data[0],
    gigs:data[1],
   
   //data[0] is response from tableA find
   // data[1] is from tableB
})   
  })
  .catch(err => console.log(err)));

Open in new window

0
I am getting an error when I run my node app using sequelize - 'Unknown column \'general_comments\' in \'field list\''. However, as seen below, I have a model with the column....general_comments.  Please see the error log below and the model code for compressor

Server started on port 5000
Executing (default): SELECT 1+1 AS result
Connection has been established successfully.
http://localhost:5000/api/alldatac:2019-09-19T05:03:25-04:00
Executing (default): SELECT `compressor_house_id`, `equipment_area`, `equipment_type`, `photo_image`, `manufacturer`, `model_number`, `serial_number`, `service`, `capacity`, `severity`, `general_comments`, `createdAt`, `updatedAt` FROM `compressor_houses` AS `compressor_house`;
{ SequelizeDatabaseError: Unknown column 'general_comments' in 'field list'
    at Query.formatError (C:\Users\Chrystelle\Omar Martin\Dropbox\web design\hurricane_dorian\node_modules\sequelize\lib\dialects\mysql\query.js:244:16)
    at Query.handler [as onResult] (C:\Users\Chrystelle\Omar Martin\Dropbox\web design\hurricane_dorian\node_modules\sequelize\lib\dialects\mysql\query.js:51:23)
    at Query.execute (C:\Users\Chrystelle\Omar Martin\Dropbox\web design\hurricane_dorian\node_modules\mysql2\lib\commands\command.js:30:14)
    at Connection.handlePacket (C:\Users\Chrystelle\Omar Martin\Dropbox\web design\hurricane_dorian\node_modules\mysql2\lib\connection.js:408:32)
    at PacketParser.Connection.packetParser.p [as onPacket] (C:\Users\Chrystelle\Omar 

Open in new window

0
Record
I am using the "each statement" with the handlebars template engine in node.js.  Unfortunately, each record is being tabbed to the right of the previous one, as the attach image shows. I would like each record to line up evenly.
Please see the code:

Here is the file:gigs.handlebars

{{#each gigs}}
<section id="gigs" class="container">
<!--<h1>All Gigs</h1>-->
<h1>{{equipment_area}}</h1>
<div class="gig">
      <h3>{{title}}</h3>
      <!--<p>{{manufacturer}}</p>-->
      <ul>
        <!--<li>Budget: {{budget}}</li>-->
        <!--<li><a href="mailto:{{contact_email}}" class="btn btn-reverse">Apply Now</a></li>-->
        <li>Equipment Type: {{equipment_type}}</li>
        <li>Manufacturer: {{manufacturer}}</li>
        <li>Model Number: {{model_number}}</li>
        <li>Serial Number: {{serial_number}}</li>
        <li>Condition: {{severity}}</li>
        <li>Comments: {{general_comments}}</li>
                
      </ul>
      <!--
      <div class="tech">
        <small>Technologies Needed: <span>{{technologies}}</span></small>
      </div>
      -->
    </div>
    {{else}}
     <p>No gigs available</p>
    {{/each}}
</section>

Open in new window


Please also see the css file:
@import url('https://fonts.googleapis.com/css?family=Lato');

:root {
  --primary-color: #568c9b;
  --primary-hover-color: #64a5b7;
  --bg-color: #333;
  --box-shadow: 3px 4px 12px rgba(0, 0, 0, 0.7);
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Lato',

Open in new window

0
Hi, I have a PHP script which calls another PHP script via a jQuery ajax call.  I can see that the call is successful and that there is a proper response from the network activity.  However I am having trouble processing that response in the calling PHP/JavaScript code.

Here's my attempt:

demo.html

From the network activity I see the response is:

["data1","data2"] and this is what I am expecting (actual data not shown)

But I cannot 'see' nor process these data in the success data in the calling code shown above.  The alerts do not fire.

Any guidance will be most appreciated and thank you in anticipation.
0
Hi Experts,

Steps to reproduce:

1. Open link fiddle
2. click on popover button.
3. popover appears, drag this to the bottom till vertical scroll bar appears.
4. drag down the vertical scroll bar than popover will go back under the button.
5. click again button, the popover will disappear.
6. Click again on button, the popover will appear to the location where the user left it earlier.

expected behavior: when a user drags down vertical scroll bar, popover should not go under the button rather stays there exactly where it is left.
0
I have a couple of PHP modules that include JS and jQuery logic.  One is chat.php and the other is fetch_user.php.  chat.php does a jQuery ajax call to fetch-user.php  and fetch_user.php returns an HTML table to chat.php which is then inserted into chat.php's DOM.  All this works perfectly.

In the data returned from fetch_user.php there is an HTML button which has some attribute data which the ajax  'success' function has access to and I can extract this data OK.

My issue is that I have a JS array which as far as I am aware has global JS access.  I want to first empty the existing data in that array (which is named logged_in_array) and the add the extracted attribute data to that array.  In my code the logged_in_array.length = 0 does not empty the array, nor does the logged_in_array.push work.

So my specific issues are that the array is not being emptied nor is the attribute datum being added to the array.

I will attach extracts of the code:

demo-code.html
0

jQuery

17K

Solutions

5K

Contributors

jQuery (Core) is a cross-browser JavaScript library that provides abstractions for common client-side tasks such as Document Object Model (DOM) traversal, DOM manipulation, event handling, animation and Ajax. jQuery also provides a platform to create plugins that extend jQuery's capabilities beyond those already provided by the library.

Related Topics