- Screen name: Smith
Smith's Profile
6 Posts
25 Responses
0
Followers
Show:
- Expanded view
- List view
Private Message
- 28-Mar-2019 11:30 AM
- Forum: Using jQuery Plugins
Hi, I have a requirement to compare two HTML DIV differences. I am trying to figure out a way to see if i can compare the HTML table cells and highlight the difference in the second div, comparing with data from from first Div. I'm not sure if there is plug-in to achieve this.I have tried with a sample code on jsFiddle to compare First and Second Div content with Default Div content. But failed. Please assist. (It should highlight differences like shown here: http://jsfiddle.net/01pfcy2s/) but this applies to strings.
The cells in the First and Second Div that are different from Default Div must highlight.
The structure of the HTML is consistent but the data is being bound from WebAPI response.
- Hello,I'm trying to load html into the div's (which ever is empty) but the following code fails to work properly. Instead, it loads html in the same (div1) everytime, overriding previously loaded html.
- <div id="Div1" Class="col-sm-3 hidden"></div>
- <div id="Div2" Class="col-sm-3 hidden"></div>
- <div id="Div3" Class="col-sm-3 hidden"></div>
- $.each(chkUnivIDs, function (index, value) {
- DisplayUnivInfo(univID);
- });
- var univID;
- function DisplayUnivInfo(tID) {
- var chkDiv = ""; univID=tID;
- if ($('#Div1').html() == "" && chkDiv == "") {
- DisplayIn($("#Div1"));
- $('#Div1').removeClass('hidden');
- chkDiv = "Not Empty";
- }
- else if ($('#Div2').html() == "" && chkDiv == "") {
- DisplayIn($("#Div2"));
- $('#Div2').removeClass('hidden');
- chkDiv = "Not Empty";
- }
- else if ($('#Div3').html() == "" && chkDiv == "") {
- DisplayIn($("#Div3"));
- $('#Div3').removeClass('hidden');
- chkDiv = "Not Empty";
- }
- }
- function DisplayIn(ele1) {
- $.ajax({
- url: '@Url.Action("Action", "Controller")',
- cache: false,
- async: false,
- data: { id: univID},
- success: function (r) {
- $(ele1).html(r);
- //$(ele1).append(r);
- },
- error: function (r) {
- alert("Ajax Error: failed to load");
- }
- });
- }
- 10-Feb-2017 12:46 PM
- Forum: Using jQuery
Hi,I'm having issue populating the html responses in 4 separate div's. All the responses are getting populated in the same div and overriding previous ones. Please assist.Sample hereThank you!- 02-Nov-2016 03:09 PM
- Forum: Using jQuery UI
Hello,I'm working on an MVC application with jQuery and Bootstrap plug-in's. I'm stuck with a scenario where I need to show multiple views inside same page(side by side). I was thinking of a modal but I'm not sure how to load two popup windows/modal side by side.Below is the link to HTML (which in practice is loaded pro-grammatically using jQuery) where I need to select checkbox's and when "Submit" is clicked, respective links (google/bing) should open inside same window as pop-up (side by side). I need to have ability to close these modals. The max number of windows is 3.Please assist.- Hello,I have a modal popup that populates the following html shown in the link below.When I select the checkbox(s), it's respective row/column values need to be appended to another table inside div ("ResultTable"). Currently, only one row gets appended. Please assist.
- <table id="mytable">
- <tr>
- <th>FileName</th>
- <th>Period</th>
- <th>Select</th>
- </tr>
- <tr>
- <td>Ginger Ale</td>
- <td>2015</td>
- <td><input type="checkbox" name="case[]"/></td>
- </tr>
- <tr>
- <td>Mocha White</td>
- <td>2012</td>
- <td><input type="checkbox" name="case[]"/></td>
- </tr>
- <tr>
- <td>Fanta Cola</td>
- <td>2016</td>
- <td><input type="checkbox" name="case[]"/></td>
- </tr>
- <tr>
- <td>Laughing Therapy</td>
- <td>2008</td>
- <td><input type="checkbox" name="case[]"/></td>
- </tr>
- <tr>
- <td>Build Page</td>
- <td>2014</td>
- <td><input type="checkbox" name="case[]"/></td>
- </tr>
- </table>
- <button id="btnGetCheckedboxes">Get Result</button>
- <div id="ResultTable">
- </div>
Script:- $(document).ready(function($) {
- $('#btnGetCheckedboxes').click(function () {
- $("#ResultTable").empty();
- /* $('#mytable').find('tr').each(function () {
- var row = $(this);
- // if (row.find('input[type="checkbox"]').is(':checked')) {
- if (row.find('input[name="case[]"]').is(':checked')) {
- $('#ResultTable').append('<table><tr data-for="'
- +'"><td>'
- +row.closest("td")
- +'</td>'
- +'<td>'
- +"TEST334"
- +'</td>'
- +'</tr></table>');
- }
- });*/
- var values = new Array();
- $.each($("input[name='case[]']:checked").closest("td").siblings("td"),
- function () {
- values.push($(this).text());
- });
- //alert(values);
- $('#ResultTable').append('<tr data-for="'
- +'"><td>'
- +values[0]
- +'</td>'
- +'<td>'
- +values[1]
- +'</td>'
- +'</tr>');
- //alert("val---" + values.join (", "));
- });
- });
Hello, I'm using a jQuery TableSorter plug-in to sort a Gridview. One of the column (Dev ID) contains data in the following format and is failing to sort in ASC order on Load: 17-143,17-162,17-45, 18-12,17-65,18-2
This above data should be sort by default as: 17-45,17-65,17-143,17-162,18-2,18-12
Please assist.
Thanks,
Smith
- «Prev
- Next »
Moderate user : Smith
© 2013 jQuery Foundation
Sponsored by and others.

