Click here to Skip to main content
16,004,453 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am new to JQuery.
I am implementing the following jquery script in my page.
HTML
<script type="text/javascript">
    (function($) {
        $(document).ready(function() {
            .sampleConfirm({text: 'Are You Sure You Wish To Delete This item ?',
                yText: 'Yes',
                nText: 'No',
                title: 'Confirm'
            });
        });
    }(jQuery));
    </script>

when i am running my page inside the chrome it is giving the problem
HTML
Uncaught SyntaxError: Unexpected token .

at 3rd line
Why i am getting this error.
Thank you...
Posted
Comments
Sergey Alexandrovich Kryukov 5-Nov-12 0:03am    
Who knows: you did not show the code of .sampleConfirm.
--SA

Why are you using a dot (.) in front of sampleConfirm. If this is an extension or functin then you should be calling it using just sampleConfirm without a leading dot.

Regards
 
Share this answer
 
You are using some kind of plugin to show simple conformation div. please visit read me file of that plugin to how to use it. there might be a id selector like this. plug-in.

eg.

http://www.jensbits.com/2009/08/10/modal-confirmation-dialog-on-form-submit-javascript-jquery-ui-and-thickbox-varieties/

JavaScript
$('#dialog').dialog({
            autoOpen: false,
            width: 400,
            modal: true,
            resizable: false,
            buttons: {
                "Submit Form": function() {
                    document.testconfirmJQ.submit();
                },
                "Cancel": function() {
                    $(this).dialog("close");
                }
            }
        });
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900