[Solved] Javascript Grammar Checking

This is probably roughly what you’re looking for: if (screen.width >= 800) { var redirect = confirm(“You are on the mobile site. Would you like to visit our full site instead?”); if (redirect) { window.location.href=”http://TEXTHIDDEN.com/”; } } You should invest some time in learning some javascript basics, and use tools like JSLint to check your … Read more

[Solved] How To replace Space by ‘+’ sign using javascript

“demo” is not an id that exists in your example. Also, I’m fairly certain you are trying to use php as javascript in there. <a id=’demo’ href=””>is you good</a> <script> const spaceToPlus = (content) => { return content.replace(/ /g, ‘+’); } let anchor = document.getElementById(‘demo’) let attributeHref = spaceToPlus(anchor.innerHTML); anchor.setAttribute(‘href’, attributeHref); </script> 0 solved How … Read more

[Solved] Disable an element/class/id from append? [closed]

Sure — add the attribute canAppend=”no” to an element then use the attribute selector like this: $(document).ready(function() { /* add the attribute selector [canAppend!=”no”] to your select or */ $(“div[canAppend!=’no’]”).append(” appended content here”); }); div { border: 2px solid black } <!– regular divs that dont have the noAppend attribute –> <div>div 1</div> <div> div … Read more

[Solved] array value by jQuery

$(document).ready(function(){ var arr = [“2″,”4″,”6″,”8″,”10”]; var index = [“1″,”5″,”9″]; var arrIndex = index.map(function(value){ return arr.indexOf(value); }) console.log(arrIndex); }) <script src=”https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js”></script> 1 solved array value by jQuery

[Solved] Issue with my website url [closed]

You need to move the home.html file in to the start directory, in other words not in any folders or just out of the OBI1.0 folder, and rename it index.html. Then you can go to obiventures.com / http://obiventures.com / http://obiventures.com/ and it will be there. Oh, and nice website by the way. 0 solved Issue … Read more

[Solved] use html button to call javascript function [closed]

I don’t fully understand your question, but I’m guessing you want your solve() function to execute when a button is pressed. Here are three options: window.onload = function() { var button = document.getElementById(“button”); // Method 1 button.addEventListener(“click”, function() { alert(“clicked1”); solve(a, b, c); // ^ Insert Params ^ }); // Method 2 button.onclick = function() … Read more

[Solved] how do I configure email on a contact form?

Seding an email directly with javascript (as it´s your tag) is not possible, but you can open the user mail client: window.open(‘mailto:[email protected]’); It´s possible to have a predetermined subject and body using these variables: window.open(‘mailto:[email protected]?subject=example_subject&body=example_body’); 3 solved how do I configure email on a contact form?

[Solved] How to tackle my JavaScript homework? [closed]

You could transform your list of words by a list of their length with map() and sort them from the longest to the shortest then just keep the first : var list = [“pain”, “poire”, “banane”, “kiwi”, “pomme”, “raisin”] var result = list.map(x => x.length).sort((a,b) => a < b)[0]; console.log(result); Or if you don’t want … Read more

[Solved] How to refactor frontend JS to Angular 2 to play nicely with PHP MVC backend? [closed]

Even tho you’re getting downvotes, let me help you to start a BIG journey if you’re willing to really do that. First, if your views are generated on the backend : “The most part of the HTML is rendered in the PHP backend.” According to that sentence, I imagine that you don’t have a REST … Read more

[Solved] Search for a value within an object in javascript [closed]

rules = [] rules[0] = { word:”house”} rules[1] = { word:”shoes”} rules[2] = { word:”tools”} rules[3] = { sentence:”horse”} rules.forEach(rule => { if (rule.word) { console.log(‘Exist. Value:’, rule.word) } else { console.log(‘Doesn\’t Exist.’) } }) Hope this helps! solved Search for a value within an object in javascript [closed]