Jump to content
php.lv forumi

jQuery konflikts


ziedinjsh

Recommended Posts

Sveiki.. nevaru saprast kapēc viņi viens otram traucē!

$.noConflict();
// autorizācija
jQuery(function(){
	jQuery('#login').submit(function(){
		jQuery.ajax({
			type: 'POST',
			url: jQuery('#login').attr('action'),
			data: jQuery('#login').serialize(),
			success: function(data){
				if(data){
					/*jQuery('#return').html(data);*/
                    showNotification({message: data, type: "warning", autoClose: true, duration: 7});
				}else{
					jQuery('#login').fadeOut(500);
					jQuery('#return').html('<p style="text-align: center;"><img src="img/loader.gif" /></p>');
						window.location = 'index.php';
				}
			}
		});
		return false;
	});
});

// Lietotāja bilde
jQuery(function(){
    var btnUpload=jQuery('#avatar');
    var status=jQuery('#status');
    new AjaxUpload(btnUpload, {
        action: 'process/pic2.php',
        name: 'avatar',
        onSubmit: function(file, ext){
            if (! (ext && /^(jpg|jpeg)$/.test(ext))){

                // extension is not allowed
                status.html('Tikai *.jpg un *.jpeg formāts.');
                return false;
            }
            status.html('Uzgaidi...');
        },
        onComplete: function(file, response){
            //On completion clear the status
            status.text('');
            //Add uploaded file to list
            if(response){
                location.reload(true);
            }
        }
    });

});

 

Ja man ir šādā secībā tad man nestrādā autorizācijas kods, bet ja otrādi tad atkal neiet augšupielādes kods. 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...