[Solved] Website posting and login [closed]

You seem to be talking about a Content Management System. I’d suggest you look at some of the (many) options out there e.g. WordPress or Drupal – neither is perfect but both are widely supported. 2 solved Website posting and login [closed]

[Solved] How can I make my JavaScript code more DRY? [closed]

Assuming the myFunction series of functions aren’t used elsewhere, you’d do: var addChangeListener = function(elem, hexInput) { elem.onchange = function() { hexInput.value = elem.value; } }; const elements = { ‘colorpicker01′:’hexinput01’, ‘colorpicker02′:’hexinput02’, ‘colorpicker03′:’hexinput03’} for(elemName in elements) { const elem = document.getElementById(elemName); const hexInput = document.getElementById(elements[elemName]); addChangeListener(elem, hexInput); } And if you need to reuse the … Read more

[Solved] How to dynamically create an object when looping an array?

I would use reduce function for that. The agg is an aggregator which aggregate our final result. The item is representing each element in the array. const arr= [ {key: ‘a’, value: ‘1’}, {key: ‘b’, value: ‘2’}, {key: ‘c’, value: ‘3’}, ]; const result = arr.reduce((agg, item) => { agg[item.key] = item.value return agg }, … 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] Trying to display Json data from a web url into a table

This is how i solved it <?php try{ $url=”the json url goes here”; // path to your JSON file $data = file_get_contents($url); // put the contents of the file into a variable $characters = json_decode($data); echo ‘<div class=”panel-heading”> <h3 align=”center”>Market Prices for ‘; echo $characters[0]->Crop; echo ‘</h3> </div>’; echo ‘<div class=”panel-body”> <table class=”table table-striped table-hover … Read more

[Solved] Get the word, from a sentence that the user is talking about [closed]

Credit: ThuverX let word if(content.indexOf(“what”) !== -1 && content[content.indexOf(“what”)+1] !== “is”) word = content[content.indexOf(“what”)+1] else if(content.indexOf(“meaning”) !== -1) word = content[content.indexOf(“meaning”)+2] else if(content.indexOf(“means”) !== -1) word = content[content.indexOf(“means”)-1] 0 solved Get the word, from a sentence that the user is talking about [closed]

[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] how to hide a tag? [closed]

This is the best I can do without knowing your code: HTML: <h4 id=”myH4″>Hello World</h4> Javascript: document.getElementById(“myH4″).style.display=”none”; or document.getElementById(“myH4″).style.visibility=”hidden”; 7 solved how to hide a tag? [closed]