jQuery Plugins » parameter https://jqueryplugins.info jQuery plugins, tutorials and resources Tue, 18 Oct 2011 19:13:16 +0000 en hourly 1 http://wordpress.org/?v=3.2.1 How to Pass Parameter to funcCall in Jquery Validation https://jqueryplugins.info/2011/10/how-to-pass-parameter-to-funccall-in-jquery-validation/ https://jqueryplugins.info/2011/10/how-to-pass-parameter-to-funccall-in-jquery-validation/#comments Fri, 07 Oct 2011 09:16:50 +0000 Admin https://jqueryplugins.info/2011/10/how-to-pass-parameter-to-funccall-in-jquery-validation/ Post link: How to Pass Parameter to funcCall in Jquery Validation

I have to pass an extra parameter to funcCall method. How to do that? And What is the use of i in the parameter? E.g: myFuncCallMethod(fields,i,rules,options) newest questions tagged jquery...

]]>
Post link: How to Pass Parameter to funcCall in Jquery Validation

I have to pass an extra parameter to funcCall method. How to do that? And What is the use of i in the parameter?
E.g: myFuncCallMethod(fields,i,rules,options)

newest questions tagged jquery – Stack Overflow

]]>
https://jqueryplugins.info/2011/10/how-to-pass-parameter-to-funccall-in-jquery-validation/feed/ 0
Jquery iframe with Modal Window pass parameter https://jqueryplugins.info/2011/10/jquery-iframe-with-modal-window-pass-parameter/ https://jqueryplugins.info/2011/10/jquery-iframe-with-modal-window-pass-parameter/#comments Thu, 06 Oct 2011 15:14:22 +0000 Admin https://jqueryplugins.info/2011/10/jquery-iframe-with-modal-window-pass-parameter/ Post link: Jquery iframe with Modal Window pass parameter

Hello I have a problem when I modify the input of a iframe that is open with SimpleModalWindow Plugin. I have the code: $ ("#imgTab").click(function(){ $ ("#iframeNode").contents().find("input[name='objParent']").val('val1'); $ ("#modalWindow").modal({ opacity:80,...

]]>
Post link: Jquery iframe with Modal Window pass parameter

Hello I have a problem when I modify the input of a iframe that is open with SimpleModalWindow Plugin.

I have the code:

 $  ("#imgTab").click(function(){
    $  ("#iframeNode").contents().find("input[name='objParent']").val('val1');
    $  ("#modalWindow").modal({
    opacity:80,
    overlayCss: {backgroundColor:"#fff"}
    });
});

the iframe is in a div

    <div id="modalWindow" style="display:none;background-color:#FFFFFF">
    <iframe src="biblioteca.php" height="600px" width="900px" id="iframeNode" name="iframeNode"></iframe>
</div>

And the element to modify into the iframe is:

<input type="text" name="objParent" id="objParent"/>

Thanks.

newest questions tagged jquery – Stack Overflow

]]>
https://jqueryplugins.info/2011/10/jquery-iframe-with-modal-window-pass-parameter/feed/ 0
How can i use jQuery’s .find method with a regular expression as the parameter? https://jqueryplugins.info/2011/08/how-can-i-use-jquerys-find-method-with-a-regular-expression-as-the-parameter/ https://jqueryplugins.info/2011/08/how-can-i-use-jquerys-find-method-with-a-regular-expression-as-the-parameter/#comments Wed, 31 Aug 2011 19:42:09 +0000 Admin https://jqueryplugins.info/2011/08/how-can-i-use-jquerys-find-method-with-a-regular-expression-as-the-parameter/ Post link: How can i use jQuery’s .find method with a regular expression as the parameter?

I have an xml that i’d like to search for “alike” results, similar to what LIKE does in SQL. I thought about doing something like $ (xml).find('regexHere'), but i don’t...

]]>
Post link: How can i use jQuery’s .find method with a regular expression as the parameter?

I have an xml that i’d like to search for “alike” results, similar to what LIKE does in SQL.
I thought about doing something like $ (xml).find('regexHere'), but i don’t know how to do that.
If that’s not the best method, could you recommend something else? The data i need to search is within node’s parameters.

newest questions tagged jquery – Stack Overflow

]]>
https://jqueryplugins.info/2011/08/how-can-i-use-jquerys-find-method-with-a-regular-expression-as-the-parameter/feed/ 0
can json_encode($last_unopened_message_row) contain more than one parameter? https://jqueryplugins.info/2011/08/can-json_encodelast_unopened_message_row-contain-more-than-one-parameter/ https://jqueryplugins.info/2011/08/can-json_encodelast_unopened_message_row-contain-more-than-one-parameter/#comments Tue, 30 Aug 2011 12:20:24 +0000 Admin https://jqueryplugins.info/2011/08/can-json_encodelast_unopened_message_row-contain-more-than-one-parameter/ Post link: can json_encode($last_unopened_message_row) contain more than one parameter?

can i have getMessageDetails.php: echo json_encode($ last_unopened_message_row,$ uniqueCode1,$ uniqueCode2,$ uniqueCode3); and then in my getJSON call i have: $ .getJSON('getMessageDetails.php', function (json,code1,code2,code3) { )}: can i have it as above?...

]]>
Post link: can json_encode($last_unopened_message_row) contain more than one parameter?

can i have getMessageDetails.php:

echo json_encode($  last_unopened_message_row,$  uniqueCode1,$  uniqueCode2,$  uniqueCode3);

and then in my getJSON call i have:

 $  .getJSON('getMessageDetails.php', function (json,code1,code2,code3) {

 )}:

can i have it as above?
thank you

newest questions tagged jquery – Stack Overflow

]]>
https://jqueryplugins.info/2011/08/can-json_encodelast_unopened_message_row-contain-more-than-one-parameter/feed/ 0
jquery query parameter parsing – “=” in query string breaks query string up https://jqueryplugins.info/2011/08/jquery-query-parameter-parsing-in-query-string-breaks-query-string-up/ https://jqueryplugins.info/2011/08/jquery-query-parameter-parsing-in-query-string-breaks-query-string-up/#comments Mon, 29 Aug 2011 20:56:38 +0000 Admin https://jqueryplugins.info/2011/08/jquery-query-parameter-parsing-in-query-string-breaks-query-string-up/ Post link: jquery query parameter parsing – “=” in query string breaks query string up

I’m trying to parse parameters from a query string using this jquery plugin and this sample query string: http://test.com/?xnJTqqWEclJnnPEvWH&cid=3DF3-00-=63-D4-DA-2F-91-6B-39-39-75-E4-C1-B7-28-12&mid=3D93-36-14-46-4D-52-9E-48-17-=6A-50-13-56-FA-0A-06&PROMO_MONTH=3D201106 Using the code for the plugin: console.log($ .getQueryParam( "cid" )); The...

]]>
Post link: jquery query parameter parsing – “=” in query string breaks query string up

I’m trying to parse parameters from a query string using this jquery plugin and this sample query string:

http://test.com/?xnJTqqWEclJnnPEvWH&cid=3DF3-00-=63-D4-DA-2F-91-6B-39-39-75-E4-C1-B7-28-12&mid=3D93-36-14-46-4D-52-9E-48-17-=6A-50-13-56-FA-0A-06&PROMO_MONTH=3D201106

Using the code for the plugin:

console.log($  .getQueryParam( "cid" ));

The cid gets divided at the first instance of the “=” sign – so instead of:

3DF3-00-=63-D4-DA-2F-91-6B-39-39-75-E4-C1-B7-28-12

I get

3DF3-00-

Is this normal behavior? Does the equals sign do something in particular in this query string? If not, how do I parse this query string so that I get the entire parameter?

newest questions tagged jquery – Stack Overflow

]]>
https://jqueryplugins.info/2011/08/jquery-query-parameter-parsing-in-query-string-breaks-query-string-up/feed/ 0
Please help with a JQuery/Javascript problem. Possible to pass a variable out of function context without passing it as a parameter to a function ? https://jqueryplugins.info/2011/08/please-help-with-a-jqueryjavascript-problem-possible-to-pass-a-variable-out-of-function-context-without-passing-it-as-a-parameter-to-a-function/ https://jqueryplugins.info/2011/08/please-help-with-a-jqueryjavascript-problem-possible-to-pass-a-variable-out-of-function-context-without-passing-it-as-a-parameter-to-a-function/#comments Sun, 14 Aug 2011 01:19:18 +0000 Admin https://jqueryplugins.info/2011/08/please-help-with-a-jqueryjavascript-problem-possible-to-pass-a-variable-out-of-function-context-without-passing-it-as-a-parameter-to-a-function/ Post link: Please help with a JQuery/Javascript problem. Possible to pass a variable out of function context without passing it as a parameter to a function ?

Basically just need to write a Jquery/Ajax that fetches Json data (Price data) from server and appends/overwrites each options text value so it would have the price difference between the...

]]>
Post link: Please help with a JQuery/Javascript problem. Possible to pass a variable out of function context without passing it as a parameter to a function ?

Basically just need to write a Jquery/Ajax that fetches Json data (Price data) from server
and appends/overwrites each options text value so it would have the price difference between the
selected option and non selected option on the end of it. Only the non selected option should have the price difference showing on the end of it, see example below.

The code you will find below pretty much does this, but only for the initial onload/document.ready.
I do not know how to store/pass the “data” object out of a functions context without passing it as a parameter to a function i.e OnSucess(data) , I would hope it can be stored in memory and used in any function. Is this at all possible? This would save me having to make a new ajax call each time (‘select’) changes and just use the json data that was returned initially.

Unfortunately $ ('select').change(OnSuccess(data);); will produce error

Also I do not know how to best append the price difference on the end of the option text value, it has to be overwritten I would think, otherwise it would just append to previous string value that already has some price difference on the end of it.

The Json object (data) array is of the format {partid = 3, price = 234}, {partid = 6, price = 53} etc.

List should look like so:

[Intel i7 950] - selected visible option
[Intel i7 960 (+ $  85)] - not selected but in the drop down list
[Intel i7 930 (- $  55)] - not selected but in the drop down list

<script type="text/javascript">

        $  (document).ready(function () {
            var arr = new Array();
            $  ('select option').each(function () {
                arr.push($  (this).val());
            });

            $  .ajax({
                type: "POST",
                url: "/Customise/GetPartPrice",
                data: { arr: arr },
                traditional: true,
                success: function (data) { OnSuccess(data)},
                dataType: "json"

            });

        });

        $  ('select').change(OnSuccess);

        function OnSuccess(data) {

            $  ('select').each(function () {

                var sov = parseInt($  (this).find('option:selected').attr('value')) || 0; //Selected option value

                var sop; //Selected Option Price

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

                    if (data[i].partid == sov) {

                        sop = data[i].price;
                        break;
                    }

                };

                $  (this).find('option').each(function () {

                    var uov = parseInt($  (this).attr('value')) || 0; //Unselected option value

                    var uop; //Unselected Option Price

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

                        if (data[d].partid == uov) {

                            uop = data[d].price;
                            break;
                        }

                    }

                    var newtext = uop - sop;
                    //var text = $  (this).attr("text");
                    $  (this).attr("text",newtext);

                });

            });

        };

    </script>

newest questions tagged jquery – Stack Overflow

]]>
https://jqueryplugins.info/2011/08/please-help-with-a-jqueryjavascript-problem-possible-to-pass-a-variable-out-of-function-context-without-passing-it-as-a-parameter-to-a-function/feed/ 0
Neatening up custom event handlers – remove need for ‘event’ parameter https://jqueryplugins.info/2011/08/neatening-up-custom-event-handlers-remove-need-for-event-parameter/ https://jqueryplugins.info/2011/08/neatening-up-custom-event-handlers-remove-need-for-event-parameter/#comments Fri, 12 Aug 2011 15:09:19 +0000 Admin https://jqueryplugins.info/2011/08/neatening-up-custom-event-handlers-remove-need-for-event-parameter/ Post link: Neatening up custom event handlers – remove need for ‘event’ parameter

I’m building some objects that will trigger custom events, and I’m using jQuery’s bind and trigger to manage this for me, like so: function MyObject() { var _this = this;...

]]>
Post link: Neatening up custom event handlers – remove need for ‘event’ parameter

I’m building some objects that will trigger custom events, and I’m using jQuery’s bind and trigger to manage this for me, like so:

function MyObject() {

    var _this = this;

    this.onUpdate = function(fn) {
        $  (_this).bind('MyObject.update', fn);
    };

    this.update = function(params) {
        //Do stuff...
        $  (_this).trigger('MyObject.update', [updatedID]);
    };

}

My problem is when I come to register other callback functions with onUpdate – the functions I pass in need to include the ‘event’ parameter for trigger to work correctly, like so:

function myCallback(event, updatedID) {
    //Do more stuff...
}

var myobject = new MyObject();
myobject.onUpdate(myCallback);

Is there a nice way I can wrap the function that I pass in to bind in the onUpdate method, so that myCallback doesn’t need the ‘event’ parameter, as it seems a bit irrelevant for my purposes?

newest questions tagged jquery – Stack Overflow

]]>
https://jqueryplugins.info/2011/08/neatening-up-custom-event-handlers-remove-need-for-event-parameter/feed/ 0