jQuery Plugins » code https://jqueryplugins.info jQuery plugins, tutorials and resources Wed, 19 Oct 2011 15:13:13 +0000 en hourly 1 http://wordpress.org/?v=3.2.1 Jquery – Run code when a person types so many characters? https://jqueryplugins.info/2011/10/jquery-run-code-when-a-person-types-so-many-characters/ https://jqueryplugins.info/2011/10/jquery-run-code-when-a-person-types-so-many-characters/#comments Thu, 13 Oct 2011 02:16:53 +0000 Admin https://jqueryplugins.info/2011/10/jquery-run-code-when-a-person-types-so-many-characters/ Post link: Jquery – Run code when a person types so many characters?

I have a form field that a person enters a telephone number. When they are done adding the telephone number, limited to 10 characters, I want to fire off some...

]]>
Post link: Jquery – Run code when a person types so many characters?

I have a form field that a person enters a telephone number. When they are done adding the telephone number, limited to 10 characters, I want to fire off some jquery code. Is this possible? If so how would I go about doing this?

newest questions tagged jquery – Stack Overflow

]]>
https://jqueryplugins.info/2011/10/jquery-run-code-when-a-person-types-so-many-characters/feed/ 0
Getting alert empty from php code ? https://jqueryplugins.info/2011/10/getting-alert-empty-from-php-code/ https://jqueryplugins.info/2011/10/getting-alert-empty-from-php-code/#comments Sun, 09 Oct 2011 20:13:24 +0000 Admin https://jqueryplugins.info/2011/10/getting-alert-empty-from-php-code/ Post link: Getting alert empty from php code ?

I not know why in following js code alert is empty without html code, my view have html code, and my_class work true for other controller, when i get alert...

]]>
Post link: Getting alert empty from php code ?

I not know why in following js code alert is empty without html code, my view have html code, and my_class work true for other controller, when i get alert this means it is work true js code but get data of php code without html. what do i do?

function guide_show($  offset = 0) {
$  find = $  this -> input -> post('find');
$  where = "name LIKE '%$  find%' OR phone LIKE '%$  find%' OR mobile LIKE '%$  find%' OR address LIKE '%$  find%' OR date_submit LIKE '%$  find%' OR useradmin_submit LIKE '%$  find%'";
$  table = "guide";
$  url_pag = "admin/submits/guide_show";
$  order = "id";
$  data = $  this -> my_class -> show($  where, $  table, $  url_pag, $  order, $  offset);
    $  this->load->view('admin/guide_show', $  data);
}

jQuery:

$  .ajax({
    type: "POST",
    dataType: "html",
    url: url,
    data: dataString,
    cache: false,
    success: function (html) {
        alert(html)
    },
    "error": function (x, y, z) {
        // callback to run if an error occurs
        alert("An error has occured:\n" + x + "\n" + y + "\n" + z);
    }
})

Here is My_class(library): http://pastebin.com/6DxjmBFC

Here is my htm code in view(guide_show): http://pastebin.com/mtubjzvB

newest questions tagged jquery – Stack Overflow

]]>
https://jqueryplugins.info/2011/10/getting-alert-empty-from-php-code/feed/ 0
How to pass jQuery to eval’d code? https://jqueryplugins.info/2011/10/how-to-pass-jquery-to-evald-code/ https://jqueryplugins.info/2011/10/how-to-pass-jquery-to-evald-code/#comments Thu, 06 Oct 2011 22:15:39 +0000 Admin https://jqueryplugins.info/2011/10/how-to-pass-jquery-to-evald-code/ Post link: How to pass jQuery to eval’d code?

First, check out my fiddle fiddle jsFiddle is nice, but sometimes it runs a bit slow, so I made this simple pure JS fiddle (can be ran locally) Working great...

]]>
Post link: How to pass jQuery to eval’d code?

First, check out my fiddle fiddle

jsFiddle is nice, but sometimes it runs a bit slow, so I made this simple pure JS fiddle (can be ran locally)

Working great so far, but I want to be able to use jQuery in my fiddle. Type alert(typeof $ ); in the bottom left box and press “Run” to see what I mean (says undefined).

So how do I pass jQuery off to the iframe and give it the correct context? I suspect I could set doc.contentWindow.$ =$ or something like that, but I still need to give the correct context so it knows where to find the elements. How would I do that?

newest questions tagged jquery – Stack Overflow

]]>
https://jqueryplugins.info/2011/10/how-to-pass-jquery-to-evald-code/feed/ 0
How to put a jQuery code into one file which will be referenced by all pages? https://jqueryplugins.info/2011/10/how-to-put-a-jquery-code-into-one-file-which-will-be-referenced-by-all-pages/ https://jqueryplugins.info/2011/10/how-to-put-a-jquery-code-into-one-file-which-will-be-referenced-by-all-pages/#comments Thu, 06 Oct 2011 18:20:59 +0000 Admin https://jqueryplugins.info/2011/10/how-to-put-a-jquery-code-into-one-file-which-will-be-referenced-by-all-pages/ Post link: How to put a jQuery code into one file which will be referenced by all pages?

I have a login popup that will pop up on every page of my site. What I want to do is once the user clicks submit, to have a single...

]]>
Post link: How to put a jQuery code into one file which will be referenced by all pages?

I have a login popup that will pop up on every page of my site. What I want to do is once the user clicks submit, to have a single JS file where the jQuery code for handling that request lives, and makes an AJAX call to validate the parameters in the DB.

I am able to get the pop up box to pop up. And the form loads. I am thinking my jQuery code will live in a separate imported file and look like this:

<script type="text/javascript" >
$  (function()
{
    $  ("input[type=submit]").click(function()
    {
        var some_params= $  ("#param").val();

        var dataString = 'Some url to send to ajax';

        if( params validated ok )
        {
            $  ('.success').fadeOut(200).hide();
            $  ('.error').fadeOut(200).show();
        }
        else
        {
            $  .ajax({
                type: "POST",
                url: "/problems/add_problem.php",
                dataType: "json",
                data: dataString,
                success: function(json)
                {
                    $  ('.success').fadeIn(200).show();
                    $  ('.error').fadeOut(200).hide();
                }
            });
        }

        return false;
    });
});
</script>

So my question is how do I make this get invoked only when the right form is submitted? The form would have some id=”some_name” but I don’t really understand how to make this jQuery code get executed only when that form element is called.

Any ideas?

Thanks!!

newest questions tagged jquery – Stack Overflow

]]>
https://jqueryplugins.info/2011/10/how-to-put-a-jquery-code-into-one-file-which-will-be-referenced-by-all-pages/feed/ 0
How to make this jquery UI code compatible with jQuery UI 1.7.2 and jQuery 1.3.2? https://jqueryplugins.info/2011/10/how-to-make-this-jquery-ui-code-compatible-with-jquery-ui-1-7-2-and-jquery-1-3-2/ https://jqueryplugins.info/2011/10/how-to-make-this-jquery-ui-code-compatible-with-jquery-ui-1-7-2-and-jquery-1-3-2/#comments Thu, 06 Oct 2011 06:13:23 +0000 Admin https://jqueryplugins.info/2011/10/how-to-make-this-jquery-ui-code-compatible-with-jquery-ui-1-7-2-and-jquery-1-3-2/ Post link: How to make this jquery UI code compatible with jQuery UI 1.7.2 and jQuery 1.3.2?

How to make this jquery UI code compatible with jQuery UI 1.7.2 and jQuery 1.3.2? http://jsfiddle.net/jitendravyas/NTeXV/2/ In a old project where jquery 1.3.2 is being used heavily so i can’t...

]]>
Post link: How to make this jquery UI code compatible with jQuery UI 1.7.2 and jQuery 1.3.2?

How to make this jquery UI code compatible with jQuery UI 1.7.2 and jQuery 1.3.2?

http://jsfiddle.net/jitendravyas/NTeXV/2/

In a old project where jquery 1.3.2 is being used heavily so i can’t change that and I want to style some checkboxes like this I made this by reading documentation on jquery ui website the later I found that it only works with jQuery 1.4.4 or greater and jQuery UI 1.8.7+ see here http://jsfiddle.net/jitendravyas/GUwjK/

but I want to make it work with jQuery 1.3.2 and jQuery UI 1.7.2

$  (function() {
        $  ( "#check1, #check2" ).button();

    });

newest questions tagged jquery – Stack Overflow

]]>
https://jqueryplugins.info/2011/10/how-to-make-this-jquery-ui-code-compatible-with-jquery-ui-1-7-2-and-jquery-1-3-2/feed/ 0
how can i make a carousel of this code https://jqueryplugins.info/2011/10/how-can-i-make-a-carousel-of-this-code/ https://jqueryplugins.info/2011/10/how-can-i-make-a-carousel-of-this-code/#comments Wed, 05 Oct 2011 07:14:42 +0000 Admin https://jqueryplugins.info/2011/10/how-can-i-make-a-carousel-of-this-code/ Post link: how can i make a carousel of this code

I have this code: initPrevNextButtons: function() { $ ('.link-prev', this.$ node).click(this.prev.bind(this)).hide(); $ ('.link-next', this.$ node).click(this.next.bind(this)); }, prev: function(e) { e.preventDefault(); this.currentPage--; $ ('.link-next', this.$ node).show(); if (this.currentPage <= 0) {...

]]>
Post link: how can i make a carousel of this code

I have this code:

initPrevNextButtons: function() {
                $  ('.link-prev', this.$  node).click(this.prev.bind(this)).hide();
                $  ('.link-next', this.$  node).click(this.next.bind(this));
            },
            prev: function(e) {
                e.preventDefault();
                this.currentPage--;
                $  ('.link-next', this.$  node).show();
                if (this.currentPage <= 0) {
                    this.currentPage = 0;
                    $  ('.link-prev', this.$  node).hide();
                } else {
                    $  ('.link-prev', this.$  node).show();
                };
                var url = this.generateURL(true);
                $  .get(url, this.write.bind(this));
            },
            next: function(e) {
                e.preventDefault();
                this.currentPage++;
                $  ('.link-prev', this.$  node).show();
                if (this.currentPage >= this.totalItems - 1) {
                    this.currentPage = this.totalItems - 1;
                    $  ('.link-next', this.$  node).hide();
                } else {
                    $  ('.link-next', this.$  node).show();
                };
                var url = this.generateURL(true);
                $  .get(url, this.write.bind(this));
            },

I have a carousel. And can click to the right and left. But when i are on the left item. The left button wil be hide. And when i on the end of the right. The right button wil be hide. But how can i make this code. That i have a carousel?

newest questions tagged jquery – Stack Overflow

]]>
https://jqueryplugins.info/2011/10/how-can-i-make-a-carousel-of-this-code/feed/ 0
How to use jQuery’s $.each()? I was told I need to use it for this code to loop it https://jqueryplugins.info/2011/10/how-to-use-jquerys-each-i-was-told-i-need-to-use-it-for-this-code-to-loop-it/ https://jqueryplugins.info/2011/10/how-to-use-jquerys-each-i-was-told-i-need-to-use-it-for-this-code-to-loop-it/#comments Sat, 01 Oct 2011 04:14:51 +0000 Admin https://jqueryplugins.info/2011/10/how-to-use-jquerys-each-i-was-told-i-need-to-use-it-for-this-code-to-loop-it/ Post link: How to use jQuery’s $.each()? I was told I need to use it for this code to loop it

How to use jQuery’s $ .each()? I was told I need to use it for this code to loop it $ (document).ready(function() { $ ("#main-rss-link").click(function() { var a = $...

]]>
Post link: How to use jQuery’s $.each()? I was told I need to use it for this code to loop it

How to use jQuery’s $ .each()? I was told I need to use it for this code to loop it

$  (document).ready(function() {
    $  ("#main-rss-link").click(function() {
        var a = $  ("li.comment").attr("id");
        var b = $  ("li.comment[id='"+a+"']");
        var c = $  ("li.comment > div.comment-body div > p > a").attr("href");
        if('#'+a == c ) {
            var d = $  ("li.comment > div.comment-body div > p > a[href='"+c+"']");
            var e = document.createElement("ul");
            $  (e).addClass("children").appendTo(b);
            d.parents("li").appendTo(e);
            $  ("li ul li div.reply").remove();
        }
    });
});

newest questions tagged jquery – Stack Overflow

]]>
https://jqueryplugins.info/2011/10/how-to-use-jquerys-each-i-was-told-i-need-to-use-it-for-this-code-to-loop-it/feed/ 0
Javascript Code not working when on my site https://jqueryplugins.info/2011/09/javascript-code-not-working-when-on-my-site/ https://jqueryplugins.info/2011/09/javascript-code-not-working-when-on-my-site/#comments Fri, 30 Sep 2011 18:18:42 +0000 Admin https://jqueryplugins.info/2011/09/javascript-code-not-working-when-on-my-site/ Post link: Javascript Code not working when on my site

I recently installed a code on my website to insert text at the position of the cursor. It works perfectly when on its own: http://www.penpalparade.com/test.php It isn’t however working with...

]]>
Post link: Javascript Code not working when on my site

I recently installed a code on my website to insert text at the position of the cursor. It works perfectly when on its own: http://www.penpalparade.com/test.php

It isn’t however working with my site as a whole: http://www.penpalparade.com/jobs.php

I’ve tried to fix it but have been unsuccessful, could someone please please help me at solving it because I’ve been at it for hours.

newest questions tagged jquery – Stack Overflow

]]>
https://jqueryplugins.info/2011/09/javascript-code-not-working-when-on-my-site/feed/ 0
Difference between jQuery code structures https://jqueryplugins.info/2011/09/difference-between-jquery-code-structures/ https://jqueryplugins.info/2011/09/difference-between-jquery-code-structures/#comments Thu, 29 Sep 2011 12:20:35 +0000 Admin https://jqueryplugins.info/2011/09/difference-between-jquery-code-structures/ Post link: Difference between jQuery code structures

What is the difference between these jQuery code structures, or is there no difference. Are they both an alias for $ (document).ready(function(){ and if so, why the dollar in the...

]]>
Post link: Difference between jQuery code structures

What is the difference between these jQuery code structures, or is there no difference.
Are they both an alias for $ (document).ready(function(){ and if so, why the dollar in the first code snippet?

jQuery(function($  ){
     // stuff
});

AND

$  (function() {
        // stuff
});

newest questions tagged jquery – Stack Overflow

]]>
https://jqueryplugins.info/2011/09/difference-between-jquery-code-structures/feed/ 0
Why doesn’t this javascript string code work in internet explorer 7? https://jqueryplugins.info/2011/09/why-doesnt-this-javascript-string-code-work-in-internet-explorer-7/ https://jqueryplugins.info/2011/09/why-doesnt-this-javascript-string-code-work-in-internet-explorer-7/#comments Sat, 17 Sep 2011 00:20:49 +0000 Admin https://jqueryplugins.info/2011/09/why-doesnt-this-javascript-string-code-work-in-internet-explorer-7/ Post link: Why doesn’t this javascript string code work in internet explorer 7?

I have the following code that works fine in IE8, firefox, chrome but not in IE7 Can someone please explain why this code below doesn’t work in IE7 ? var...

]]>
Post link: Why doesn’t this javascript string code work in internet explorer 7?

I have the following code that works fine in IE8, firefox, chrome but not in IE7

Can someone please explain why this code below doesn’t work in IE7 ?

  var id = $  (this).attr("id");
  var nextStep = id[id.length - 1];

basically, IE7 doesn’t seem to understand this line:

   id[id.length - 1]

newest questions tagged jquery – Stack Overflow

]]>
https://jqueryplugins.info/2011/09/why-doesnt-this-javascript-string-code-work-in-internet-explorer-7/feed/ 0