[Solved] Need help linking 2k files into html [closed]

Given your specific situation as explained in the chat, you have no access to the ‘back end’ you DO have access and permission to change the directory-structure and file-names of the course-materials (pdf-files) current path & filenaming conventions are a mess (don’t exist) and unpredictable there is currently nothing linking course-codes with course-descriptions/course-materials every course … Read more

[Solved] What’s way to define variable is better and why?

Javascript is functionally scoped, so in the first way, a is defined globally, while in the second, it’s defined in the scope of the function DoSomething. Also note that in the first method, you’re calling DoSomething incorrectly. Instead of calling it after the timeout, you’re calling it immediately, and passing it’s result (which is nothing … Read more

[Solved] how to remove excess data in javascript array [closed]

Your selector is considering all the checkboxes on the page which are checked so the extra values are of some other checkboxes, instead use .map on input:checkbox:checked[name=”lecture”] $(‘#separate_course_list’).on(“change”, “:checkbox”, function () { var values = $(‘input:checkbox:checked[name=”lecture”]’).map(function () { return this.value; }).get(); // [“1”, “2”, “4”] $(“input[name=”comment”]”).val(values); //this input saves array }); 4 solved how to … Read more

[Solved] jQuery multiple getElementByID

I think this will help you to achieve your goal. I have removed some unwanted details from your example, and try to keep it as simple as possible. <div class=”action” > <span class=”MyBtn” rel=”myModal1″ style=”color:orange”>Title 1</span> </div> <!– The Modal 1 –> <div id=’myModal1′ class=”modal” style=”display:none”> <!– Modal content 1 –> <div class=”modal-content”> <div class=”modal-header”> … Read more

[Solved] how i can sum qty by grouping name of goods? [closed]

You can use each tr and filter to implement your requirement: $(“button”).click(function(){ var group = []; $(“tr”).each(function(index,item){ if(index > 0){ let id = $(item).find(‘td’).eq(0).text(); let name = $(item).find(‘td’).eq(1).text(); let count = parseInt($(item).find(‘td’).eq(2).text()); let exist = group.filter(c=>c.name == name)[0]; if(exist != undefined){ exist.count += count; }else{ group.push({id : id, name: name, count : count}); } } … Read more

[Solved] Get one JSON value with another?

Parse it and Iterate over it var data = JSON.parse(‘{“XXX”:{“x”:”1″,”y”:”2″},”XXX”:{“x”:”3″,”y”:”3″}}’); var y = 0; $.each(data, function(i, item) { alert(‘With Jquery X = ‘+item.x); alert(‘With Jquery Y = ‘+item.y); //if you want to get the value of y based on x or vice versa then check if(item.x == 3) { y = item.y; } }); // … Read more

[Solved] React jQuery(this) selector is not working

this points to React component instance and not the input element. You can achieve this using event.target class LoginReg extends Component { render() { function minimizeLabel(event){ $(event.target).closest(“.Reg-fields”).css(“border-bottom”, “2px solid #f99”); $(event.target).closest(“label”).css(“top”, “-15px”).css(“font-size”, “.7em”).css(“transition”, “.3s ease-out”); } return ( <div> <div className=”custom-container”> <div className=”Reg-fields”> <input type=”email” onClick={minimizeLabel}/> <label>Email</label> </div> </div> ); } 1 solved React jQuery(this) … Read more

[Solved] Convert from JavaScript function to jQuery

This is my solution, in the future post your HTML code for helping us to solve the problem: $(function(){ $(‘.thumbnail’).click(function(){ $(‘#mainVideo’).replaceWith(‘<video id=”mainVideo” width=320 height=240 autoplay></video>’); $(‘#mainVideo’).html($(this).html()); }); }); Here is the fiddle 4 solved Convert from JavaScript function to jQuery

[Solved] Jquery Multiple Select Show values in [closed]

Try it like, var ul = $(‘<ul>’).appendTo(‘body’); function createList() { ul.empty(); $(‘select option:selected’).each(function() { li = $(‘<li/>’).text($(this).text()).attr(‘value’, this.value); li.appendTo(ul); }); } $(‘select’).on(‘change’, function() { createList() }).trigger(‘change’); <script src=”https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js”></script> <select name=”is_format” id=”is_format”> <option value=”A4″>{l s=”A4″}</option> <option value=”A3″>{l s=”A3″}</option> </select> <select name=”is_color” id=”is_color”> <option value=”Couleur” selected>{l s=”Couleur”}</option> <option value=”Noir/Blanc”>{l s=”Noir et Blanc”}</option> </select> 3 solved Jquery Multiple … Read more

[Solved] Refresh table after seconds

You need to use $.ajax like $(function(){ function getdata(){ $.ajax({ url:’getdata.php’, success:function(response){ $(‘#dataTables-example tbody’).html(response); } }); } setInterval(function(){getdata()},5000); }); getdata.php <?php $req = mysqli_query($con, ‘select user_id, user_name from users’); while ($dnn = mysqli_fetch_array($req)) { echo “<tr> <td>” . $dnn[‘user_id’] . “</td> <td>” . $dnn[‘user_name’] . “</td> </tr>”; } ?> 6 solved Refresh table after seconds