Tags » JQuery

jQuery: função simples para remover links inválidos (remover href)

Na função abaixo quando a página termina de ser carregada, eu realizei uma busca nos itens do meu menu, buscando o valor do href e simplesmente remove caso o link fosse inexistente, que era simbolizado pela #, deixando somente o href caso o link fosse uma url completa. 29 more words

Development

how to design a website.

एक वेबसाइट को डिजाईन करने के लिए क्या करे
नमस्कार दोस्तों आज हम आपको बताएगे की किसी भी वेबसाइट को डिजाईन करने के लिए क्या करना पड़ता है |

Build a Single Page Application with jQuery & AJAX

Requirements

  • You should have a basic understanding of JavaScript fundamentals
  • Knowing jQuery is a plus, but certainly not required!
  • Have Node and NPM installed (instructions included in the first section of this course)
457 more words

Web

Input Field on focus Label out Effect

HTML




  Full name
  




jQuery

$('input').each(function(){
	checkfield($(this));
}).on('focus', function(){
	$(this).closest('.textfield').find('label').addClass('focused');
}).on('blur', function(){
	checkfield($(this));
});

$('.textfield label').on('click', function(){
	$(this).next('input').focus();
});

function checkfield($this){
	var parent = $this.closest('.textfield').find('label');
		if($this.val() == ''){
		parent.removeClass('focused');
	}else{
		parent.addClass('focused'); 
	}
}
… 114 more words
JQuery

Get Url Query String

The following code will return a JavaScript Object containing the URL parameters:

function getUrlVars()
{
    var vars = [], hash;
    var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
    for(var i = 0; i < hashes.length; i++)
    {
        hash = hashes[i].split('=');
        vars.push(hash[0]);
        vars] = hash[1];
    }
    return vars;
}
… 44 more words
JQuery

Javascript - Populating Select 2 from JSON data

function getVersion (questionnaire) {

$(‘#_VERSIONS’).children(‘option:not(:first)’).remove();

$.post(‘inl_sev_042_J_nvg.php’,{“QUESTIONNAIRE” : questionnaire}, function(data) {

var i;

for (i = 0; i < data.length; i++) {

text = data[i];

newOption = new Option(text, i, false, false); 72 more words

Javascript