[Solved] What’s wrong in this JavaScript code?

I have to agree with comments above, not sure what you’re doing but…the problem is that a submit handler is a function not the string you’re assigning, this: subBut.onclick = (document.getElementById(‘helllo’).innerHTML=(submi(document.getElementById(‘user’).value, document.getElementById(‘passw’).value))); should be: subBut.onclick = function() { document.getElementById(‘helllo’).innerHTML= submi(document.getElementById(‘user’).value, document.getElementById(‘passw’).value); return false; //for testing, prevent form submission }; You can test the updated version … Read more

[Solved] javascript remove NULL from the result

First, you can get rid of some of that inner DOM selection by making your initial qSA selection more specific: “.product_card a .product_card__title”. Then you can use .filter() by returning the result of checking if each element .includes() the “rocker” text. Do this before mapping the .href. Finally, .map() those results to the .href of … Read more

[Solved] Grab link from database field and use it to turn another field I’ve grabbed into link [closed]

I fixed it myself. I simply updated the quote field in the database to include the link. For example: <a href=”http://www.bestmoviequote.com/movies/gone-with-the-wind.php”>”Frankly, my dear, I don’t give a damn.”</a> It correctly displays the link on the page. Thanks for all your help. solved Grab link from database field and use it to turn another field I’ve … Read more

[Solved] Why is my page reloading on form submission? [closed]

Samuel is correct about the JavaScript error you are getting, but you still are far from getting that form submitted. In your script below you reference variables by the names of “email” and “name”, but these variables do not exist. $(document).ready(function(){ $(‘submit’).click(function(){ $.ajax({ type:’POST’, url: email_form.php, data:{ name: name, email: email, }, success: function(msg){ alert(‘Email … Read more

[Solved] javascript regex to validate the input

You can try ^(?!0\*0)(?:\d+\*\d+,?)+$. ^ and $ ensure that the entire string matches. (?!0\*0) is a negative look ahead to check that the string is not 0*0. (?: and ) indicates that the contents are a non-capturing group \d+ matches one or more digits (0–9) \* matches a literal * character \d+ matches one or … Read more

[Solved] Javascript days of the week [closed]

Your current weekDay() function will return the current day of the week, but your other code calls weekDay() and doesn’t do anything with its return value. You need to use the value together with some string concatenation: var today = weekDay(); document.write(“<iframe src=”” + today + “”.htm’></iframe>”); Or just: document.write(“<iframe src=”” + weekDay() + “”.htm’></iframe>”); … Read more

[Solved] I’m having trouble validating my form for some reason the error messages do not appear when the forename or surname is not enterd

Trailing commas (,) are illegal in JavaScript. When you do something like this: rules: { firstname: ‘required’, lastname: ‘required’, } the JavaScript engine will think that }, is the next item in the rules object. You need to do something like this: rules: { firstname: ‘required’, lastname: ‘required’ // <– no comma at end } … Read more

[Solved] jquery ajax dont works – succes and error [closed]

Although you don’t state what the exact problem is, you are using the wrong function: appendTo tries to append $(‘#block-message’) to the Zpráva neodeslána element (which does not exist). You need something like the append(), text() or html() functions instead. For example: $(‘#block-message’).text(‘Zpráva odeslána’).addClass(‘good’).slideUp(); 6 solved jquery ajax dont works – succes and error [closed]

[Solved] append the URL so that it will not give 404 [closed]

To append vars to the end of a url, the first one needs to start with the question mark (?), with subsequent variables added with an ampersand (&). For example: ‘http://my.site.com/index.html?variable1=hello&variable2=goodbye’ This can be done for “any number of specific reasons” solved append the URL so that it will not give 404 [closed]

[Solved] Creating Image slider using only jQuery

Mabye something like this: jQuery(document).ready(function () { var images = []; var loop; var i = 0; images[0] = “https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQ1GfA01TRDgrh-c5xWzrwSuiapiZ6b-yzDoS5JpmeVoB0ZCA87”; images[1] = “https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQQSyUWiS4UUhdP1Xz81I_sFG6QNAyxN7KLGLI0-RjroNcZ5-HLiw”; images[2] = “https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcT_E_OgC6RiyFxKtw03NeWyelfRgJ3Ax3SnZZrufNkUe0nX3pjQ”; $(‘img’, ‘.maindiv’).mouseover(function () { //Get divs inside main div and reverse them, so right is first var divs = $($(‘div’,’.maindiv’).get().reverse()); //Set up loop loop = setInterval(function(){ divs.each(function(key, div){ if … Read more

[Solved] What is happening here in this code? [closed]

The util module has exported an object that contains (probably amongst others) a function under the key inherits: exports = { inherits: function() … } The express module on the other hand, has directly exported a whole function, and that function is immediately invoked and the result assigned to the variable express. module.exports = exports … Read more