Powered By Blogger
Showing posts with label jQuery. Show all posts
Showing posts with label jQuery. Show all posts

Thursday, February 7, 2019

cookie in jQuery


Set cookie
$.cookie("test", 1);
 Access cookie value : 
 $.cookie('test');
To delete:
$.removeCookie("test");
Additionally, to set a timeout of a certain number of days (10 here) on the cookie:
$.cookie("test", 1, { expires : 10 });
Should include cookie library
https://github.com/carhartl/jquery-cookie
https://github.com/carhartl/jquery-cookie/blob/master/src/jquery.cookie.js 
 

Wednesday, May 24, 2017

hidden input change event OR jquery event on value change of input hidden

function survey(selector, callback) {
   var input = $(selector);
   var oldvalue = input.val();
   setInterval(function(){
      if (input.val()!=oldvalue){
          oldvalue = input.val();
          callback();
      }
   }, 100);
}
survey('#id_inpout', function(){console.log('changed')}); 


https://stackoverflow.com/questions/12580761/hidden-input-change-event

Tuesday, September 13, 2016

get iframe form submit value in jquery



https://cmlenz.github.io/jquery-iframe-transport/


http://terminalapp.net/submitting-a-form-with-target-set-to-a-script-generated-iframe-on-ie/



$("iframe.form_container").submit(function() {
    $.ajax(this.action, {
        data: $(":text", this).serializeArray(),
        files: $(":file", this),
        iframe: true,
        processData: false
    }).complete(function(data) {
        console.log(data);
    });
});


$("iframe.submit").click(function() {
console.log('cancancan enter');
alert();
 });



$('input:submit[class=submit]').click(function() {
    var name = $('iframe').contents().find('.input_name').val();
console.log(name);
});





function explode(){

  //$val = document.getElementById('iframe').contentWindow.document.body.innerHTML 
$val = $('iframe').contents().find('.logged_in_name').html();
$vall = $('iframe').contents().find('.logged_in_email').html();
$( ".section-footer" ).append( $val );

}
setTimeout(explode, 5000);